pub struct PcbLib {
pub unique_id: String,
pub components: Vec<PcbComponent>,
/* private fields */
}Expand description
A PCB footprint library containing components.
Fields§
§unique_id: StringUnique ID of the library.
components: Vec<PcbComponent>Components (footprints) in the library.
Implementations§
Source§impl PcbLib
impl PcbLib
Sourcepub fn open_file<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn open_file<P: AsRef<Path>>(path: P) -> Result<Self>
Open and read a PcbLib file from a path.
Sourcepub fn save_to_file<P: AsRef<Path>>(&self, path: P) -> Result<()>
pub fn save_to_file<P: AsRef<Path>>(&self, path: P) -> Result<()>
Save the PcbLib to a file path.
Sourcepub fn component_count(&self) -> usize
pub fn component_count(&self) -> usize
Get the number of components.
Sourcepub fn iter(&self) -> impl Iterator<Item = &PcbComponent>
pub fn iter(&self) -> impl Iterator<Item = &PcbComponent>
Iterate over components.
Trait Implementations§
Source§impl DumpTree for PcbLib
impl DumpTree for PcbLib
Source§fn dump(&self, tree: &mut TreeBuilder)
fn dump(&self, tree: &mut TreeBuilder)
Dump this item to the tree builder.
Source§fn dump_to_string(&self) -> String
fn dump_to_string(&self) -> String
Convenience method to dump to a string.
Source§fn dump_to_string_with_options(&self, options: DumpOptions) -> String
fn dump_to_string_with_options(&self, options: DumpOptions) -> String
Convenience method to dump to a string with options.
Auto Trait Implementations§
impl Freeze for PcbLib
impl RefUnwindSafe for PcbLib
impl Send for PcbLib
impl Sync for PcbLib
impl Unpin for PcbLib
impl UnwindSafe for PcbLib
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
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