pub struct NodeState<I, A> {
pub id: I,
pub addr: A,
pub meta: Meta,
pub state: State,
pub protocol_version: ProtocolVersion,
pub delegate_version: DelegateVersion,
}Expand description
Represents a node in the cluster
Fields§
§id: IThe id of the node.
addr: AThe address of the node.
meta: MetaMetadata from the delegate for this node.
state: StateState of the node.
protocol_version: ProtocolVersionThe protocol version of the node is speaking.
delegate_version: DelegateVersionThe delegate version of the node is speaking.
Implementations§
Source§impl<I, A> NodeState<I, A>
impl<I, A> NodeState<I, A>
Sourcepub const fn protocol_version(&self) -> ProtocolVersion
pub const fn protocol_version(&self) -> ProtocolVersion
Returns the protocol version of the node is speaking
Sourcepub const fn delegate_version(&self) -> DelegateVersion
pub const fn delegate_version(&self) -> DelegateVersion
Returns the delegate version of the node is speaking
Sourcepub fn with_address(self, val: A) -> Self
pub fn with_address(self, val: A) -> Self
Sets the address of the node (Builder pattern)
Sourcepub const fn with_state(self, val: State) -> Self
pub const fn with_state(self, val: State) -> Self
Sets the state of the node (Builder pattern)
Sourcepub const fn with_protocol_version(self, val: ProtocolVersion) -> Self
pub const fn with_protocol_version(self, val: ProtocolVersion) -> Self
Sets the protocol version of the node is speaking (Builder pattern)
Sourcepub const fn with_delegate_version(self, val: DelegateVersion) -> Self
pub const fn with_delegate_version(self, val: DelegateVersion) -> Self
Sets the delegate version of the node is speaking (Builder pattern)
Source§impl<I, A> NodeState<I, A>
impl<I, A> NodeState<I, A>
Sourcepub const fn new(id: I, addr: A, state: State) -> Self
pub const fn new(id: I, addr: A, state: State) -> Self
Construct a new node with the given name, address and state.
Sourcepub fn set_address(&mut self, addr: A) -> &mut Self
pub fn set_address(&mut self, addr: A) -> &mut Self
Sets the address of the node state
Sourcepub fn set_protocol_version(
&mut self,
protocol_version: ProtocolVersion,
) -> &mut Self
pub fn set_protocol_version( &mut self, protocol_version: ProtocolVersion, ) -> &mut Self
Set the protocol version of the alive message is speaking.
Sourcepub fn set_delegate_version(
&mut self,
delegate_version: DelegateVersion,
) -> &mut Self
pub fn set_delegate_version( &mut self, delegate_version: DelegateVersion, ) -> &mut Self
Set the delegate version of the alive message is speaking.
Source§impl<I: CheapClone, A: CheapClone> NodeState<I, A>
impl<I: CheapClone, A: CheapClone> NodeState<I, A>
Trait Implementations§
Source§impl<I, A> Archive for NodeState<I, A>where
I: Archive,
A: Archive,
Meta: Archive,
State: Archive,
ProtocolVersion: Archive,
DelegateVersion: Archive,
impl<I, A> Archive for NodeState<I, A>where
I: Archive,
A: Archive,
Meta: Archive,
State: Archive,
ProtocolVersion: Archive,
DelegateVersion: Archive,
Source§type Archived = ArchivedNodeState<I, A>
type Archived = ArchivedNodeState<I, A>
Source§type Resolver = NodeStateResolver<I, A>
type Resolver = NodeStateResolver<I, A>
Source§fn resolve(&self, resolver: Self::Resolver, out: Place<Self::Archived>)
fn resolve(&self, resolver: Self::Resolver, out: Place<Self::Archived>)
Source§const COPY_OPTIMIZATION: CopyOptimization<Self> = _
const COPY_OPTIMIZATION: CopyOptimization<Self> = _
serialize. Read moreSource§impl<I: CheapClone, A: CheapClone> CheapClone for NodeState<I, A>
impl<I: CheapClone, A: CheapClone> CheapClone for NodeState<I, A>
Source§fn cheap_clone(&self) -> Self
fn cheap_clone(&self) -> Self
Source§impl<'de, I, A> Deserialize<'de> for NodeState<I, A>where
I: Deserialize<'de>,
A: Deserialize<'de>,
impl<'de, I, A> Deserialize<'de> for NodeState<I, A>where
I: Deserialize<'de>,
A: Deserialize<'de>,
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>,
Source§impl<__D: Fallible + ?Sized, I, A> Deserialize<NodeState<I, A>, __D> for Archived<NodeState<I, A>>where
I: Archive,
<I as Archive>::Archived: Deserialize<I, __D>,
A: Archive,
<A as Archive>::Archived: Deserialize<A, __D>,
Meta: Archive,
<Meta as Archive>::Archived: Deserialize<Meta, __D>,
State: Archive,
<State as Archive>::Archived: Deserialize<State, __D>,
ProtocolVersion: Archive,
<ProtocolVersion as Archive>::Archived: Deserialize<ProtocolVersion, __D>,
DelegateVersion: Archive,
<DelegateVersion as Archive>::Archived: Deserialize<DelegateVersion, __D>,
impl<__D: Fallible + ?Sized, I, A> Deserialize<NodeState<I, A>, __D> for Archived<NodeState<I, A>>where
I: Archive,
<I as Archive>::Archived: Deserialize<I, __D>,
A: Archive,
<A as Archive>::Archived: Deserialize<A, __D>,
Meta: Archive,
<Meta as Archive>::Archived: Deserialize<Meta, __D>,
State: Archive,
<State as Archive>::Archived: Deserialize<State, __D>,
ProtocolVersion: Archive,
<ProtocolVersion as Archive>::Archived: Deserialize<ProtocolVersion, __D>,
DelegateVersion: Archive,
<DelegateVersion as Archive>::Archived: Deserialize<DelegateVersion, __D>,
Source§impl<I: CheapClone, A: CheapClone> From<Alive<I, A>> for NodeState<I, A>
impl<I: CheapClone, A: CheapClone> From<Alive<I, A>> for NodeState<I, A>
Source§impl<I, A> PartialEq<ArchivedNodeState<I, A>> for NodeState<I, A>where
I: Archive,
A: Archive,
Meta: Archive,
State: Archive,
ProtocolVersion: Archive,
DelegateVersion: Archive,
<I as Archive>::Archived: PartialEq<I>,
<A as Archive>::Archived: PartialEq<A>,
<Meta as Archive>::Archived: PartialEq<Meta>,
<State as Archive>::Archived: PartialEq<State>,
<ProtocolVersion as Archive>::Archived: PartialEq<ProtocolVersion>,
<DelegateVersion as Archive>::Archived: PartialEq<DelegateVersion>,
impl<I, A> PartialEq<ArchivedNodeState<I, A>> for NodeState<I, A>where
I: Archive,
A: Archive,
Meta: Archive,
State: Archive,
ProtocolVersion: Archive,
DelegateVersion: Archive,
<I as Archive>::Archived: PartialEq<I>,
<A as Archive>::Archived: PartialEq<A>,
<Meta as Archive>::Archived: PartialEq<Meta>,
<State as Archive>::Archived: PartialEq<State>,
<ProtocolVersion as Archive>::Archived: PartialEq<ProtocolVersion>,
<DelegateVersion as Archive>::Archived: PartialEq<DelegateVersion>,
Source§impl<I, A> PartialEq<NodeState<I, A>> for ArchivedNodeState<I, A>where
I: Archive,
A: Archive,
Meta: Archive,
State: Archive,
ProtocolVersion: Archive,
DelegateVersion: Archive,
<I as Archive>::Archived: PartialEq<I>,
<A as Archive>::Archived: PartialEq<A>,
<Meta as Archive>::Archived: PartialEq<Meta>,
<State as Archive>::Archived: PartialEq<State>,
<ProtocolVersion as Archive>::Archived: PartialEq<ProtocolVersion>,
<DelegateVersion as Archive>::Archived: PartialEq<DelegateVersion>,
impl<I, A> PartialEq<NodeState<I, A>> for ArchivedNodeState<I, A>where
I: Archive,
A: Archive,
Meta: Archive,
State: Archive,
ProtocolVersion: Archive,
DelegateVersion: Archive,
<I as Archive>::Archived: PartialEq<I>,
<A as Archive>::Archived: PartialEq<A>,
<Meta as Archive>::Archived: PartialEq<Meta>,
<State as Archive>::Archived: PartialEq<State>,
<ProtocolVersion as Archive>::Archived: PartialEq<ProtocolVersion>,
<DelegateVersion as Archive>::Archived: PartialEq<DelegateVersion>,
Source§impl<__S: Fallible + ?Sized, I, A> Serialize<__S> for NodeState<I, A>where
I: Serialize<__S>,
A: Serialize<__S>,
Meta: Serialize<__S>,
State: Serialize<__S>,
ProtocolVersion: Serialize<__S>,
DelegateVersion: Serialize<__S>,
impl<__S: Fallible + ?Sized, I, A> Serialize<__S> for NodeState<I, A>where
I: Serialize<__S>,
A: Serialize<__S>,
Meta: Serialize<__S>,
State: Serialize<__S>,
ProtocolVersion: Serialize<__S>,
DelegateVersion: Serialize<__S>,
impl<I: Eq, A: Eq> Eq for NodeState<I, A>
impl<I, A> StructuralPartialEq for NodeState<I, A>
Auto Trait Implementations§
impl<I, A> !Freeze for NodeState<I, A>
impl<I, A> RefUnwindSafe for NodeState<I, A>where
I: RefUnwindSafe,
A: RefUnwindSafe,
impl<I, A> Send for NodeState<I, A>
impl<I, A> Sync for NodeState<I, A>
impl<I, A> Unpin for NodeState<I, A>
impl<I, A> UnwindSafe for NodeState<I, A>where
I: UnwindSafe,
A: UnwindSafe,
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive, it may be
unsized. Read moreSource§fn archived_metadata(
&self,
) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
fn archived_metadata( &self, ) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<K, Q> Comparable<Q> for K
impl<K, Q> Comparable<Q> for K
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§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
key and return true if they are equal.Source§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
Source§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
key and return true if they are equal.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> ⓘ
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> ⓘ
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.