[][src]Trait identifier::Identifier

pub trait Identifier: Eq {
    type Id;
    type ParseError;
    pub fn generate() -> Self::Id;
pub fn format(&self) -> String;
pub fn parse_str(s: &str) -> Result<Self::Id, Self::ParseError>; }

Trait for id structures.

This trait is not intented to be implemented manually you should use derive. Refers to the module documentation to provide a module with functions to:

  • generate inner id / u128 value
  • validate

Associated Types

Loading content...

Required methods

pub fn generate() -> Self::Id[src]

Generate a new id

pub fn format(&self) -> String[src]

format the id to a string

pub fn parse_str(s: &str) -> Result<Self::Id, Self::ParseError>[src]

Parse a string to an id

Loading content...

Implementors

Loading content...