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 new() -> TraitBuilder
pub fn new() -> TraitBuilder
Creates a new instance of 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.
Trait Implementations§
Source§impl Default for TraitBuilder
impl Default for TraitBuilder
Source§fn default() -> TraitBuilder
fn default() -> TraitBuilder
A default implementation of TraitBuilder, creating a new instance of TraitBuilder.
Auto Trait Implementations§
impl Freeze for TraitBuilder
impl RefUnwindSafe for TraitBuilder
impl Send for TraitBuilder
impl Sync for TraitBuilder
impl Unpin for TraitBuilder
impl UnwindSafe for TraitBuilder
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.