pub trait Identifier: Eq {
type Id;
type ParseError;
// Required methods
fn generate() -> Self::Id;
fn format(&self) -> String;
fn parse_str(s: &str) -> Result<Self::Id, Self::ParseError>;
}
Expand description
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
Required Associated Types§
type Id
type ParseError
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.