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 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.