pub struct DynamicId<KS: IdKindSubset> { /* private fields */ }Expand description
Dynamically typed ID, can represent any kind “object” Id
Implementations§
Source§impl<KS: IdKindSubset> DynamicId<KS>
impl<KS: IdKindSubset> DynamicId<KS>
Sourcepub fn new(kind: Kind, id: [u8; 16]) -> Self
pub fn new(kind: Kind, id: [u8; 16]) -> Self
Construct a new dynamicId.
Panics if Kind is not member of the KS subset.
Sourcepub fn upcast<KS2: IdKindSubset + IdKindSupersetOf<KS>>(&self) -> DynamicId<KS2>
pub fn upcast<KS2: IdKindSubset + IdKindSupersetOf<KS>>(&self) -> DynamicId<KS2>
Infallibly upcast this into a superset DynamicId.
Sourcepub const fn to_raw_array(self) -> [u8; 16]
pub const fn to_raw_array(self) -> [u8; 16]
Get the byte-wise representation of the ID, without type information. NB! This erases the dynamic tag!
Trait Implementations§
Source§impl<KS: IdKindSubset> Clone for DynamicId<KS>
impl<KS: IdKindSubset> Clone for DynamicId<KS>
Source§impl<KS: IdKindSubset> Debug for DynamicId<KS>
impl<KS: IdKindSubset> Debug for DynamicId<KS>
Source§impl<'de, KS: IdKindSubset> Deserialize<'de> for DynamicId<KS>
impl<'de, KS: IdKindSubset> Deserialize<'de> for DynamicId<KS>
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<KS: IdKindSubset> Display for DynamicId<KS>
impl<KS: IdKindSubset> Display for DynamicId<KS>
Source§impl<S: IdKindSubset> FromStr for DynamicId<S>
impl<S: IdKindSubset> FromStr for DynamicId<S>
Source§impl<KS: IdKindSubset> Hash for DynamicId<KS>
impl<KS: IdKindSubset> Hash for DynamicId<KS>
Source§impl<KS: IdKindSubset> Id128DynamicArrayConv for DynamicId<KS>
impl<KS: IdKindSubset> Id128DynamicArrayConv for DynamicId<KS>
Source§impl<KS: IdKindSubset> Ord for DynamicId<KS>
impl<KS: IdKindSubset> Ord for DynamicId<KS>
Source§impl<KS: IdKindSubset> PartialEq for DynamicId<KS>
impl<KS: IdKindSubset> PartialEq for DynamicId<KS>
Source§impl<KS: IdKindSubset> PartialOrd for DynamicId<KS>
impl<KS: IdKindSubset> PartialOrd for DynamicId<KS>
Source§impl<KS: IdKindSubset> Serialize for DynamicId<KS>
impl<KS: IdKindSubset> Serialize for DynamicId<KS>
impl<KS: IdKindSubset> Copy for DynamicId<KS>
impl<KS: IdKindSubset> Eq for DynamicId<KS>
Auto Trait Implementations§
impl<KS> Freeze for DynamicId<KS>
impl<KS> RefUnwindSafe for DynamicId<KS>where
KS: RefUnwindSafe,
impl<KS> Send for DynamicId<KS>where
KS: Send,
impl<KS> Sync for DynamicId<KS>where
KS: Sync,
impl<KS> Unpin for DynamicId<KS>where
KS: Unpin,
impl<KS> UnwindSafe for DynamicId<KS>where
KS: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request