pub enum Source {
Zmx {
path: PathBuf,
text: String,
},
SystemFile {
path: PathBuf,
text: String,
},
Project {
path: PathBuf,
text: String,
project: Box<Project>,
cache: Arc<SourceCache>,
},
}Expand description
1 回だけ読んだ系のファイル。プロジェクトは JSON を 1 回読んで解釈し、状態の名前・ビームスプリッターの経路・
状態ごとの系をそこから引く(CLI・serve・Python の共通の入口)。系ファイル・.zmx は種類とパスだけ持ち、Source::open で読む
Variants§
Implementations§
Source§impl Source
impl Source
Sourcepub fn read(path: &Path) -> Result<Source, Error>
pub fn read(path: &Path) -> Result<Source, Error>
パスの種類を決め、プロジェクトなら読んで解釈する。無い・フォルダ・読めないは Error::Io、
プロジェクトの中身の誤りは Error::Invalid
Sourcepub fn zmx_configs(
&self,
opt: &LoadOptions,
cfgs: &[usize],
) -> Result<Vec<System>, Error>
pub fn zmx_configs( &self, opt: &LoadOptions, cfgs: &[usize], ) -> Result<Vec<System>, Error>
.zmx の構成 cfgs(1 始まり、空なら全部)の系(読んだときの中身から。.zmx でなければ誤り)
Sourcepub fn configurations(&self) -> Result<usize, Error>
pub fn configurations(&self) -> Result<usize, Error>
.zmx の構成の数(.zmx でなければ 1)
Sourcepub fn project_text(&self) -> Option<&str>
pub fn project_text(&self) -> Option<&str>
プロジェクトファイルの中身(状態は当てない。プロジェクトファイルでなければ None)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Source
impl RefUnwindSafe for Source
impl Send for Source
impl Sync for Source
impl Unpin for Source
impl UnsafeUnpin for Source
impl UnwindSafe for Source
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more