Trait IDCollection

Source
pub trait IDCollection<ID: IDLike> {
    // Required methods
    fn get_id_by_str(&self, id: &str) -> Result<ID>;
    fn get_id(&self, id: &ID) -> Result<ID>;
}
Expand description

A data structure containing a set of IDs

Required Methods§

Source

fn get_id_by_str(&self, id: &str) -> Result<ID>

Get the ID from the collection by its string representation.

§Arguments
  • id - The string representation of the ID
§Returns

A copy of the ID in self, or an error if not found.

Source

fn get_id(&self, id: &ID) -> Result<ID>

Check if the ID is in the collection, returning a copy of it if found.

§Arguments
  • id - The ID to check
§Returns

A copy of the ID in self, or an error if not found.

Implementations on Foreign Types§

Source§

impl<ID: IDLike> IDCollection<ID> for HashSet<ID>

Source§

fn get_id_by_str(&self, id: &str) -> Result<ID>

Source§

fn get_id(&self, id: &ID) -> Result<ID>

Source§

impl<ID: IDLike> IDCollection<ID> for IndexSet<ID>

Source§

fn get_id_by_str(&self, id: &str) -> Result<ID>

Source§

fn get_id(&self, id: &ID) -> Result<ID>

Implementors§