pub struct Class(_, pub ClassProperties);Expand description
The key is the index of the class from https://www.dnd5eapi.co/api/classes
Tuple Fields§
§1: ClassPropertiesImplementations§
Source§impl Class
impl Class
pub async fn get_spellcasting_ability_index(&self) -> Result<String, ApiError>
pub async fn get_spellcasting_slots( &self, ) -> Result<Option<LevelSpellcasting>, ApiError>
pub async fn set_level( &mut self, new_level: u8, ) -> Result<Vec<ChoosableCustomLevelFeature>, ApiError>
pub async fn get_levels_features( &self, from_level: Option<u8>, passive: bool, ) -> Result<Vec<String>, ApiError>
pub fn apply_option(&mut self, option: ChoosableCustomLevelFeatureOption)
Source§impl Class
impl Class
Sourcepub async fn get_spells(&self) -> Result<Vec<Spell>, ApiError>
pub async fn get_spells(&self) -> Result<Vec<Spell>, ApiError>
Returns the spells that the class can cast If it’s a knowladge based class it will return the spells that the character can know If it’s a prepared based class it will return the spells that the character can prepare
pub async fn get_ready_spells(&self) -> Result<Vec<Vec<String>>, ApiError>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Class
impl<'de> Deserialize<'de> for Class
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 Eq for Class
Auto Trait Implementations§
impl Freeze for Class
impl !RefUnwindSafe for Class
impl !Send for Class
impl !Sync for Class
impl Unpin for Class
impl !UnwindSafe for Class
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.