pub struct Group {
pub type_: String,
pub name: String,
pub attributes: IndexMap<String, Vec<Attribute>>,
pub subgroups: Vec<Group>,
}Expand description
General group struct
Groups contain simple attributes, complex attributes, and other groups
Fields§
§type_: String§name: String§attributes: IndexMap<String, Vec<Attribute>>§subgroups: Vec<Group>Implementations§
Source§impl Group
impl Group
Sourcepub fn new(type_: &str, name: &str) -> Self
pub fn new(type_: &str, name: &str) -> Self
Create a group with empty attributes and sub-groups
Sourcepub fn from_group_item(group_item: GroupItem) -> Self
pub fn from_group_item(group_item: GroupItem) -> Self
Convert an AST GroupItem::Group variant into a Group struct
Sourcepub fn into_group_item(self) -> GroupItem
pub fn into_group_item(self) -> GroupItem
Convert a Group struct into a GroupItem::Group variant
Sourcepub fn complex_attribute(&self, name: &str) -> Option<&Vec<Value>>
pub fn complex_attribute(&self, name: &str) -> Option<&Vec<Value>>
Get first match of complex attribute by name
Sourcepub fn simple_attribute(&self, name: &str) -> Option<&Value>
pub fn simple_attribute(&self, name: &str) -> Option<&Value>
Get first match of simple attribute by name
Sourcepub fn iter_complex_attributes(
&self,
) -> impl Iterator<Item = (&String, &Vec<Value>)>
pub fn iter_complex_attributes( &self, ) -> impl Iterator<Item = (&String, &Vec<Value>)>
Iterate over the complex attributes
Sourcepub fn iter_complex_attributes_mut(
&mut self,
) -> impl Iterator<Item = (&String, &mut Vec<Value>)>
pub fn iter_complex_attributes_mut( &mut self, ) -> impl Iterator<Item = (&String, &mut Vec<Value>)>
Iterate over the complex attributes mutably
Sourcepub fn iter_simple_attributes(&self) -> impl Iterator<Item = (&String, &Value)>
pub fn iter_simple_attributes(&self) -> impl Iterator<Item = (&String, &Value)>
Iterate over the simple attributes
Sourcepub fn iter_simple_attributes_mut(
&mut self,
) -> impl Iterator<Item = (&String, &mut Value)>
pub fn iter_simple_attributes_mut( &mut self, ) -> impl Iterator<Item = (&String, &mut Value)>
Iterate over the simple attributes mutably
Sourcepub fn iter_subgroups_of_type<'a>(
&'a self,
type_: &'a str,
) -> impl Iterator<Item = &'a Group>
pub fn iter_subgroups_of_type<'a>( &'a self, type_: &'a str, ) -> impl Iterator<Item = &'a Group>
Iterate over the subgroups of a given type
Sourcepub fn iter_subgroups_of_type_mut<'a>(
&'a mut self,
type_: &'a str,
) -> impl Iterator<Item = &'a mut Group>
pub fn iter_subgroups_of_type_mut<'a>( &'a mut self, type_: &'a str, ) -> impl Iterator<Item = &'a mut Group>
Iterate over the subgroups of a given type mutably
Sourcepub fn iter_subgroups(&self) -> impl Iterator<Item = &Group>
pub fn iter_subgroups(&self) -> impl Iterator<Item = &Group>
Iterate over the subgroups
Sourcepub fn iter_subgroups_mut(&mut self) -> impl Iterator<Item = &mut Group>
pub fn iter_subgroups_mut(&mut self) -> impl Iterator<Item = &mut Group>
Iterate over the subgroups mutably
Sourcepub fn get_cell_mut(&mut self, name: &str) -> Option<&mut Group>
pub fn get_cell_mut(&mut self, name: &str) -> Option<&mut Group>
Get cell by name mutably
Sourcepub fn get_pin_mut(&mut self, name: &str) -> Option<&mut Group>
pub fn get_pin_mut(&mut self, name: &str) -> Option<&mut Group>
Get pin by name mutably
Sourcepub fn iter_cells(&self) -> impl Iterator<Item = &Group>
pub fn iter_cells(&self) -> impl Iterator<Item = &Group>
Iterate over the cells
Sourcepub fn iter_cells_mut(&mut self) -> impl Iterator<Item = &mut Group>
pub fn iter_cells_mut(&mut self) -> impl Iterator<Item = &mut Group>
Iterate over the cells mutably
Sourcepub fn iter_pins_mut(&mut self) -> impl Iterator<Item = &mut Group>
pub fn iter_pins_mut(&mut self) -> impl Iterator<Item = &mut Group>
Iterate over the pins mutably
Trait Implementations§
impl StructuralPartialEq for Group
Auto Trait Implementations§
impl Freeze for Group
impl RefUnwindSafe for Group
impl Send for Group
impl Sync for Group
impl Unpin for Group
impl UnsafeUnpin for Group
impl UnwindSafe for Group
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> 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>
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