[][src]Trait folia::store::StringStore

pub trait StringStore<Key> where
    Key: TryFrom<usize> + Copy + Debug,
    usize: TryFrom<Key>,
    <usize as TryFrom<Key>>::Error: Debug
{ fn items_mut(&mut self) -> &mut Vec<Option<String>>;
fn index_mut(&mut self) -> &mut HashMap<String, Key>;
fn items(&self) -> &Vec<Option<String>>;
fn iter(&self) -> Iter<'_, Option<String>>;
fn index(&self) -> &HashMap<String, Key>; fn add(&mut self, item: Cow<'_, str>) -> Result<Key, FoliaError> { ... }
fn get_key(&self, item: &str) -> Option<Key> { ... }
fn is_empty(&self) -> bool { ... }
fn len(&self) -> usize { ... }
fn get(&self, key: Key) -> Option<&str> { ... }
fn get_mut(&mut self, key: Key) -> Option<&mut String> { ... } }

Required methods

fn items_mut(&mut self) -> &mut Vec<Option<String>>

fn index_mut(&mut self) -> &mut HashMap<String, Key>

fn items(&self) -> &Vec<Option<String>>

fn iter(&self) -> Iter<'_, Option<String>>

fn index(&self) -> &HashMap<String, Key>

Loading content...

Provided methods

fn add(&mut self, item: Cow<'_, str>) -> Result<Key, FoliaError>

Add a new item to the store (takes ownership)

fn get_key(&self, item: &str) -> Option<Key>

Checks if an item is already in the store and returns the key if so

fn is_empty(&self) -> bool

fn len(&self) -> usize

Returns the number of items in the store (including items that were removed)

fn get(&self, key: Key) -> Option<&str>

Retrieves an element from the store

fn get_mut(&mut self, key: Key) -> Option<&mut String>

Retrieves an element from the store

Loading content...

Implementors

impl StringStore<u16> for SubsetStore[src]

impl StringStore<u32> for ClassStore[src]

Loading content...