pub trait PrefixedId {
    const PREFIX: &'static str;

    fn new_id() -> String { ... }
    fn id_prefix() -> String { ... }
}
Expand description

PrefixId

Is a trait that is used to add prefix based ID generation to a given domain object, e.g. an object that gets inserted into the database

Required Associated Constants§

The prefix that is desired

Provided Methods§

Generated a new id with the given prefix

Return the prefix

Implementors§