[][src]Struct s3wf2::document::CharacterSet

pub struct CharacterSet { /* fields omitted */ }

Contains characters metadata.

Methods

impl CharacterSet[src]

pub fn new() -> CharacterSet[src]

Creates a new instance.

pub fn add_male(
    &mut self,
    id: &str,
    name: &str
) -> Result<(), SemanticErrorKind>
[src]

Adds a male character.

Parameters

  • id - The reference ID
  • name - The name displayed in document

pub fn add_female(
    &mut self,
    id: &str,
    name: &str
) -> Result<(), SemanticErrorKind>
[src]

Adds a female character.

Parameters

  • id - The reference ID
  • name - The name displayed in document

pub fn add_mob(&mut self, id: &str, name: &str) -> Result<(), SemanticErrorKind>[src]

Adds a mob character.

Parameters

  • id - The reference ID
  • name - The name displayed in document

pub fn add_custom(
    &mut self,
    id: &str,
    name: &str,
    color: &str
) -> Result<(), SemanticErrorKind>
[src]

Adds a custom color character.

Parameters

  • id - The reference ID
  • name - The name displayed in document
  • color - A colorcode, which consists of 3 or 6 hexadecimal digits

pub fn get(&self, id: &str) -> Option<&CharacterType>[src]

Gets the character type related to the ID.

pub fn characters(&self) -> impl Iterator<Item = (&String, &CharacterType)>[src]

Returns character iterator. The order is guaranteed to be consistent.

Trait Implementations

impl Default for CharacterSet[src]

impl Display for CharacterSet[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.