pub trait HasDomain {
    const DOMAIN: Domain;
}
Expand description

Meant to be implemented by domain types to associate the Domain with the type.

Example

extern crate oysterpack_uid;
use oysterpack_uid::*;

struct User;

impl HasDomain for User {
    const DOMAIN: Domain = Domain("User");
}

type UserId = TypedULID<User>;

fn main() {
    let id : DomainULID = UserId::generate().into();
    assert_eq!(id.domain(), User::DOMAIN.name());
}

Required Associated Constants§

Domain

Implementors§