pub struct Project {
pub format: String,
pub version: u32,
pub name: String,
pub circuit: Circuit,
pub files: Vec<SourceFile>,
pub options: Options,
pub extra: BTreeMap<String, Value>,
}Expand description
A complete project.
Fields§
§format: String§version: u32§name: String§circuit: Circuit§files: Vec<SourceFile>§options: Options§extra: BTreeMap<String, Value>Unknown keys survive a save, as in the circuit format.
Implementations§
Source§impl Project
impl Project
Sourcepub fn add_file(
&mut self,
name: impl Into<String>,
content: impl Into<String>,
) -> &mut SourceFile
pub fn add_file( &mut self, name: impl Into<String>, content: impl Into<String>, ) -> &mut SourceFile
Add or replace a file in the project’s own group.
pub fn file(&self, name: &str) -> Option<&SourceFile>
Sourcepub fn group(&self, group: Option<&str>) -> impl Iterator<Item = &SourceFile>
pub fn group(&self, group: Option<&str>) -> impl Iterator<Item = &SourceFile>
Files belonging to one board’s group.
Sourcepub fn validate(&self) -> Result<(), ProjectError>
pub fn validate(&self) -> Result<(), ProjectError>
Structural checks a hand-edited file can fail.
pub fn to_json(&self) -> Result<String, ProjectError>
pub fn from_json(text: &str) -> Result<Self, ProjectError>
pub fn save(&self, path: &Path) -> Result<(), ProjectError>
pub fn load(path: &Path) -> Result<Self, ProjectError>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Project
impl<'de> Deserialize<'de> for Project
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Forget for Project
impl Freeze for Project
impl Move for Project
impl RefUnwindSafe for Project
impl Send for Project
impl Sync for Project
impl Unpin for Project
impl UnsafeUnpin for Project
impl UnwindSafe for Project
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