pub struct MemberId<Tag, Id = u32> { /* private fields */ }Expand description
A typed identifier for a member of a Cluster.
The Tag type parameter ties this ID to a specific cluster, preventing
accidental mixing of member IDs from different clusters at compile time.
It wraps an Id (see the module documentation).
Implementations§
Source§impl<Tag, Id> MemberId<Tag, Id>
impl<Tag, Id> MemberId<Tag, Id>
Sourcepub fn into_tagless(self) -> Id
pub fn into_tagless(self) -> Id
Unwraps the ID, dropping the cluster tag.
Sourcepub fn from_tagless(inner: Id) -> Self
pub fn from_tagless(inner: Id) -> Self
Wraps an ID as a member of this cluster.
Sourcepub fn as_tagless(&self) -> &Id
pub fn as_tagless(&self) -> &Id
The wrapped ID.
Source§impl<Tag> MemberId<Tag, u32>
impl<Tag> MemberId<Tag, u32>
Sourcepub fn from_raw_id(raw_id: u32) -> Self
pub fn from_raw_id(raw_id: u32) -> Self
The member numbered raw_id.
Hydro Deploy and the simulator number each cluster’s members 0..n.
Sourcepub fn get_raw_id(&self) -> u32
pub fn get_raw_id(&self) -> u32
This member’s number.
Trait Implementations§
Source§impl<'a, Tag, Id: Deserialize<'a>> Deserialize<'a> for MemberId<Tag, Id>
impl<'a, Tag, Id: Deserialize<'a>> Deserialize<'a> for MemberId<Tag, Id>
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'a>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'a>,
Deserialize this value from the given Serde deserializer. Read more
impl<Tag, Id: Eq> Eq for MemberId<Tag, Id>
Source§impl<Tag, Id: Ord> Ord for MemberId<Tag, Id>
impl<Tag, Id: Ord> Ord for MemberId<Tag, Id>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl<Tag, Id: Ord> PartialOrd for MemberId<Tag, Id>
impl<Tag, Id: Ord> PartialOrd for MemberId<Tag, Id>
Source§impl<'a, Ctx> QuotedWithContextWithProps<'a, MemberId<<<<Ctx as ContextWithLocation<'a>>::Location as Location<'a>>::Root as IsCluster>::Tag, <<<Ctx as ContextWithLocation<'a>>::Location as Location<'a>>::Root as IsCluster>::Id>, Ctx, ()> for ClusterSelfId<'a>
impl<'a, Ctx> QuotedWithContextWithProps<'a, MemberId<<<<Ctx as ContextWithLocation<'a>>::Location as Location<'a>>::Root as IsCluster>::Tag, <<<Ctx as ContextWithLocation<'a>>::Location as Location<'a>>::Root as IsCluster>::Id>, Ctx, ()> for ClusterSelfId<'a>
fn splice_untyped_ctx_props(self, ctx: &Ctx) -> (Expr, Props)where
Self: Sized,
fn splice_typed_ctx_props(self, ctx: &Ctx) -> (Expr, Props)where
Self: Sized,
fn splice_fn1_ctx_props<I, O>(self, ctx: &Ctx) -> (Expr, Props)
fn splice_fn1_borrow_ctx_props<I, O>(self, ctx: &Ctx) -> (Expr, Props)
fn splice_fn2_ctx_props<I1, I2, O>(self, ctx: &Ctx) -> (Expr, Props)
fn splice_fn2_borrow_ctx_props<I1, I2, O>(self, ctx: &Ctx) -> (Expr, Props)
fn splice_fn2_borrow_mut_ctx_props<I1, I2, O>(self, ctx: &Ctx) -> (Expr, Props)
fn splice_fnmut1_ctx_props<I, O>(self, ctx: &Ctx) -> (Expr, Props)
fn splice_fnmut1_borrow_ctx_props<I, O>(self, ctx: &Ctx) -> (Expr, Props)
fn splice_fnmut2_ctx_props<I1, I2, O>(self, ctx: &Ctx) -> (Expr, Props)
fn splice_fnmut2_borrow_ctx_props<I1, I2, O>(self, ctx: &Ctx) -> (Expr, Props)
fn splice_fnmut2_borrow_mut_ctx_props<I1, I2, O>( self, ctx: &Ctx, ) -> (Expr, Props)
Auto Trait Implementations§
impl<Tag, Id> Forget for MemberId<Tag, Id>
impl<Tag, Id> Freeze for MemberId<Tag, Id>
impl<Tag, Id> Move for MemberId<Tag, Id>
impl<Tag, Id> RefUnwindSafe for MemberId<Tag, Id>where
Id: RefUnwindSafe,
Tag: RefUnwindSafe,
impl<Tag, Id> Send for MemberId<Tag, Id>
impl<Tag, Id> Sync for MemberId<Tag, Id>
impl<Tag, Id> Unpin for MemberId<Tag, Id>
impl<Tag, Id> UnsafeUnpin for MemberId<Tag, Id>
impl<Tag, Id> UnwindSafe for MemberId<Tag, Id>where
Id: UnwindSafe,
Tag: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.