pub struct Ability { /* private fields */ }Expand description
An ability record in a logical slot. The hero is supplied by its parent Hero record.
Implementations§
Source§impl Ability
impl Ability
pub fn new( slot: LogicalSlot, variant: Option<AbilityVariant>, name: Fact<LocalizedText>, evidence: Vec<EvidenceRef>, ) -> Self
pub fn with_keyword(self, keyword: impl Into<KeywordId>) -> Self
pub fn with_stat(self, key: StatKey, value: Fact<StatValue>) -> Self
pub fn reference(&self, hero: &HeroId) -> AbilityRef
pub fn slot(&self) -> &LogicalSlot
pub fn variant(&self) -> Option<&AbilityVariant>
pub fn name(&self) -> &Fact<LocalizedText>
pub fn keywords(&self) -> impl Iterator<Item = &KeywordId>
pub fn has_keyword(&self, keyword: &str) -> bool
pub fn stat(&self, key: &StatKey) -> Option<&Fact<StatValue>>
pub fn stats(&self) -> impl Iterator<Item = (&StatKey, &Fact<StatValue>)>
pub fn evidence(&self) -> &[EvidenceRef]
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Ability
impl<'de> Deserialize<'de> for Ability
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Ability
Auto Trait Implementations§
impl Freeze for Ability
impl RefUnwindSafe for Ability
impl Send for Ability
impl Sync for Ability
impl Unpin for Ability
impl UnsafeUnpin for Ability
impl UnwindSafe for Ability
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