pub struct SelectorEngine<'a> { /* private fields */ }Expand description
Query execution engine for schematic records.
The engine operates on a RecordTree<SchRecord> and provides methods to
execute selector queries against the tree.
Implementations§
Source§impl<'a> SelectorEngine<'a>
impl<'a> SelectorEngine<'a>
Sourcepub fn new(tree: &'a RecordTree<SchRecord>) -> Self
pub fn new(tree: &'a RecordTree<SchRecord>) -> Self
Create a new selector engine for the given record tree.
Sourcepub fn set_sheet_name(&mut self, sheet_id: RecordId, name: String)
pub fn set_sheet_name(&mut self, sheet_id: RecordId, name: String)
Set the sheet name for a specific sheet header. This should be called with the document name (filename without extension), not the Title parameter which is typically the project title.
Sourcepub fn set_document_name(&mut self, name: String)
pub fn set_document_name(&mut self, name: String)
Set the sheet name for all sheet headers in the tree. Convenience method for single-sheet documents where the document name applies to the single SheetHeader record.
Sourcepub fn query(&self, selector: &Selector) -> Vec<QueryMatch>
pub fn query(&self, selector: &Selector) -> Vec<QueryMatch>
Execute a selector query and return matching record IDs.
Sourcepub fn get_component_designator(&self, id: RecordId) -> Option<&str>
pub fn get_component_designator(&self, id: RecordId) -> Option<&str>
Get the designator of a component by ID.
Sourcepub fn get_component_value(&self, id: RecordId) -> Option<&str>
pub fn get_component_value(&self, id: RecordId) -> Option<&str>
Get the value of a component by ID.
Sourcepub fn get_component_part_number(&self, id: RecordId) -> Option<&str>
pub fn get_component_part_number(&self, id: RecordId) -> Option<&str>
Get the part number (lib_reference) of a component by ID.
Auto Trait Implementations§
impl<'a> Freeze for SelectorEngine<'a>
impl<'a> RefUnwindSafe for SelectorEngine<'a>
impl<'a> Send for SelectorEngine<'a>
impl<'a> Sync for SelectorEngine<'a>
impl<'a> Unpin for SelectorEngine<'a>
impl<'a> UnwindSafe for SelectorEngine<'a>
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
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>
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>
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