pub struct Id<T> { /* private fields */ }Expand description
A phantom-typed identifier, generic over the domain object it names.
net-lattice-model defines per-domain aliases (type RouteId = Id<Route>;)
instead of hand-writing lookalike structs (RouteId, InterfaceId,
…). Passing a RouteId where an InterfaceId is expected fails to
compile, rather than silently looking up the wrong object.
Id<T> serializes as its bare underlying value, independent of T —
see ARCHITECTURE.md’s note on Id<T>’s serialization stability.
Implementations§
Trait Implementations§
impl<T> Copy for Id<T>
impl<T> Eq for Id<T>
Auto Trait Implementations§
impl<T> Freeze for Id<T>
impl<T> RefUnwindSafe for Id<T>
impl<T> Send for Id<T>
impl<T> Sync for Id<T>
impl<T> Unpin for Id<T>
impl<T> UnsafeUnpin for Id<T>
impl<T> UnwindSafe for Id<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more