Trait GroupID

Source
pub trait GroupID {
    // Required methods
    fn is_valid_group_id(&self) -> Result<&str, GroupIDError>;
    fn display(&self) -> String;
    fn get_group_id(&self) -> Option<&str>;
}
Expand description

Format and validation trait for GroupIDs

This trait is used to expand String and string slices for validity checks and GroupID escaped formatting applied

For more information on GroupID changing and escaping, see the module-level documentation.

§TODO: Examples

TODO: Maybe skip examples for this one

Required Methods§

Source

fn is_valid_group_id(&self) -> Result<&str, GroupIDError>

Checks if the current GroupID is Valid

If the current GroupID is valid, the GroupID get’s returned as Ok(&str).

Otherwise an error of type GroupIDError is returned describing why the current GroupID is invalid.

Source

fn display(&self) -> String

Return an cloned String of the current GroupID with the delimiters replaced.

TODO: UPGRADE OR REFERENCE ANOTHER DOCUMENTATION TO PREVENT DISCRAPENCIES BETWEEN DOCS

Returns a cloned String with the following replacements:

Source

fn get_group_id(&self) -> Option<&str>

Maybe wrong place. TODO: Consider moving to GroupIDChanger

TODO:

  • Move?
  • Document
  • Test

Implementations on Foreign Types§

Source§

impl GroupID for &str

Source§

fn get_group_id(&self) -> Option<&str>

Maybe wrong place. TODO: Consider moving to GroupIDChanger

Source§

fn is_valid_group_id(&self) -> Result<&str, GroupIDError>

Source§

fn display(&self) -> String

Source§

impl GroupID for String

Source§

fn get_group_id(&self) -> Option<&str>

Maybe wrong place. TODO: Consider moving to GroupIDChanger

Source§

fn is_valid_group_id(&self) -> Result<&str, GroupIDError>

Source§

fn display(&self) -> String

Implementors§