Skip to main content

Group

Struct Group 

Source
pub struct Group { /* private fields */ }
Expand description

A group that can contain structures and other groups.

Groups provide organizational hierarchy for structures in the viewer. Enabling or disabling a group affects all of its descendants.

Implementations§

Source§

impl Group

Source

pub fn new(name: impl Into<String>) -> Self

Creates a new group with the given name.

Source

pub fn name(&self) -> &str

Returns the name of this group.

Source

pub fn is_enabled(&self) -> bool

Returns whether this group is enabled.

Source

pub fn set_enabled(&mut self, enabled: bool)

Sets whether this group is enabled.

Source

pub fn show_child_details(&self) -> bool

Returns whether child details should be shown in UI.

Source

pub fn set_show_child_details(&mut self, show: bool)

Sets whether child details should be shown in UI.

Source

pub fn parent_group(&self) -> Option<&str>

Returns the parent group name, if any.

Source

pub fn set_parent_group(&mut self, parent: Option<String>)

Sets the parent group.

Source

pub fn add_structure(&mut self, type_name: &str, name: &str)

Adds a structure to this group.

The structure is identified by “type_name:name” format.

Source

pub fn remove_structure(&mut self, type_name: &str, name: &str)

Removes a structure from this group.

Source

pub fn contains_structure(&self, type_name: &str, name: &str) -> bool

Returns whether this group contains a structure.

Source

pub fn add_child_group(&mut self, group_name: &str)

Adds a child group.

Source

pub fn remove_child_group(&mut self, group_name: &str)

Removes a child group.

Source

pub fn contains_child_group(&self, group_name: &str) -> bool

Returns whether this group contains a child group.

Source

pub fn child_structures(&self) -> impl Iterator<Item = (&str, &str)>

Returns the child structure identifiers.

Source

pub fn child_groups(&self) -> impl Iterator<Item = &str>

Returns the child group names.

Source

pub fn num_child_structures(&self) -> usize

Returns the number of child structures.

Source

pub fn num_child_groups(&self) -> usize

Returns the number of child groups.

Source

pub fn is_empty(&self) -> bool

Returns true if this group has no children.

Trait Implementations§

Source§

impl Clone for Group

Source§

fn clone(&self) -> Group

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Group

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.