Struct mini_functions::errors::traits::HasTrait
source · pub struct HasTrait {
pub trait_id: u64,
pub has_trait: bool,
pub add_trait: bool,
}
Expand description
A struct to represent the presence of a Trait instance.
Fields§
§trait_id: u64
The identifier of the Trait instance.
has_trait: bool
Whether the Trait instance is present.
add_trait: bool
Whether the Trait instance was added.
Implementations§
source§impl HasTrait
impl HasTrait
sourcepub fn new(trait_id: u64) -> HasTrait
pub fn new(trait_id: u64) -> HasTrait
Creates a new instance of HasTrait with the given trait_id.
sourcepub fn has_trait(&self, key: &Trait) -> bool
pub fn has_trait(&self, key: &Trait) -> bool
Returns true if the HasTrait instance has the given Trait key.
sourcepub fn remove_trait(&mut self, key: &Trait)
pub fn remove_trait(&mut self, key: &Trait)
Removes the given Trait key from the HasTrait instance.
sourcepub fn is_add_trait(&self) -> bool
pub fn is_add_trait(&self) -> bool
Returns true if the Trait instance was added to the HasTrait instance.
sourcepub fn is_has_trait(&self) -> bool
pub fn is_has_trait(&self) -> bool
Returns true if the HasTrait instance has the Trait instance.
sourcepub fn is_remove_trait(&self) -> bool
pub fn is_remove_trait(&self) -> bool
Returns true if the Trait instance was removed from the HasTrait instance.
Auto Trait Implementations§
impl RefUnwindSafe for HasTrait
impl Send for HasTrait
impl Sync for HasTrait
impl Unpin for HasTrait
impl UnwindSafe for HasTrait
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