pub struct LibraryManager { /* private fields */ }Expand description
Manages schematic libraries and component instantiation.
Implementations§
Source§impl LibraryManager
impl LibraryManager
Sourcepub fn get_library(&self, path: &str) -> Option<&SchLib>
pub fn get_library(&self, path: &str) -> Option<&SchLib>
Get a loaded library by path.
Sourcepub fn list_libraries(&self) -> Vec<&str>
pub fn list_libraries(&self) -> Vec<&str>
List all loaded libraries.
Sourcepub fn find_component(
&self,
lib_reference: &str,
) -> Option<(&str, &SchLibComponent)>
pub fn find_component( &self, lib_reference: &str, ) -> Option<(&str, &SchLibComponent)>
Search for a component across all loaded libraries.
Sourcepub fn list_all_components(&self) -> Vec<(&str, &str, &str)>
pub fn list_all_components(&self) -> Vec<(&str, &str, &str)>
List all components in all loaded libraries.
Sourcepub fn search_components(&self, pattern: &str) -> Vec<(&str, &str, &str)>
pub fn search_components(&self, pattern: &str) -> Vec<(&str, &str, &str)>
Search components by pattern (case-insensitive substring match).
Sourcepub fn init_designators_from(&mut self, doc: &SchDoc)
pub fn init_designators_from(&mut self, doc: &SchDoc)
Initialize designator counters from an existing schematic.
Sourcepub fn next_designator(&mut self, prefix: &str) -> String
pub fn next_designator(&mut self, prefix: &str) -> String
Get the next designator for a given prefix.
Sourcepub fn suggest_designator_prefix(&self, lib_reference: &str) -> &str
pub fn suggest_designator_prefix(&self, lib_reference: &str) -> &str
Suggest a designator prefix based on component name.
Sourcepub fn instantiate_component(
&mut self,
lib_reference: &str,
location: CoordPoint,
orientation: Orientation,
designator: Option<&str>,
doc: &mut SchDoc,
) -> Result<usize>
pub fn instantiate_component( &mut self, lib_reference: &str, location: CoordPoint, orientation: Orientation, designator: Option<&str>, doc: &mut SchDoc, ) -> Result<usize>
Instantiate a component from a library into a schematic.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LibraryManager
impl RefUnwindSafe for LibraryManager
impl Send for LibraryManager
impl Sync for LibraryManager
impl Unpin for LibraryManager
impl UnwindSafe for LibraryManager
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