Struct idk::traits::TraitBuilder
source · pub struct TraitBuilder {
pub traits: Vec<Trait>,
}
Expand description
A struct to manage a collection of Trait instances.
Fields§
§traits: Vec<Trait>
A vector of Trait instances
Implementations§
source§impl TraitBuilder
impl TraitBuilder
sourcepub fn add_trait(&mut self, label: &str) -> &Trait
pub fn add_trait(&mut self, label: &str) -> &Trait
Adds a new Trait instance with the given label to the collection.
sourcepub fn get_trait(&self, label: &str) -> Option<&Trait>
pub fn get_trait(&self, label: &str) -> Option<&Trait>
Finds and returns the Trait instance with the given label.
sourcepub fn delete_trait(&mut self, label: &str) -> bool
pub fn delete_trait(&mut self, label: &str) -> bool
Deletes the Trait instance with the given label from the collection.