pub struct PushNodeState<I, A> {
pub id: I,
pub addr: A,
pub meta: Meta,
pub incarnation: u32,
pub state: State,
pub protocol_version: ProtocolVersion,
pub delegate_version: DelegateVersion,
}Expand description
Push node state is the state push to the remote server.
Fields§
§id: IThe id of the push node state.
addr: AThe address of the push node state.
meta: MetaMetadata from the delegate for this push node state.
incarnation: u32The incarnation of the push node state.
state: StateThe state of the push node state.
protocol_version: ProtocolVersionThe protocol version of the push node state is speaking.
delegate_version: DelegateVersionThe delegate version of the push node state is speaking.
Implementations§
Source§impl<I, A> PushNodeState<I, A>
impl<I, A> PushNodeState<I, A>
Sourcepub const fn incarnation(&self) -> u32
pub const fn incarnation(&self) -> u32
Returns the incarnation of the push node state
Sourcepub const fn protocol_version(&self) -> ProtocolVersion
pub const fn protocol_version(&self) -> ProtocolVersion
Returns the protocol version of the push node state is speaking
Sourcepub const fn delegate_version(&self) -> DelegateVersion
pub const fn delegate_version(&self) -> DelegateVersion
Returns the delegate version of the push node state is speaking
Sourcepub fn with_address(self, val: A) -> Self
pub fn with_address(self, val: A) -> Self
Sets the address of the push node state (Builder pattern)
Sourcepub fn with_meta(self, val: Meta) -> Self
pub fn with_meta(self, val: Meta) -> Self
Sets the meta of the push node state (Builder pattern)
Sourcepub const fn with_incarnation(self, val: u32) -> Self
pub const fn with_incarnation(self, val: u32) -> Self
Sets the incarnation of the push node state (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 push node state (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 push node state 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 push node state is speaking (Builder pattern)
Source§impl<I, A> PushNodeState<I, A>
impl<I, A> PushNodeState<I, A>
Sourcepub const fn new(incarnation: u32, id: I, addr: A, state: State) -> Self
pub const fn new(incarnation: u32, id: I, addr: A, state: State) -> Self
Construct a new push node state with the given id, 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 push node state
Sourcepub fn set_incarnation(&mut self, incarnation: u32) -> &mut Self
pub fn set_incarnation(&mut self, incarnation: u32) -> &mut Self
Sets the incarnation of the push 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
Sets the protocol version of the push node state
Sourcepub fn set_delegate_version(
&mut self,
delegate_version: DelegateVersion,
) -> &mut Self
pub fn set_delegate_version( &mut self, delegate_version: DelegateVersion, ) -> &mut Self
Sets the delegate version of the push node state
Source§impl<I: CheapClone, A: CheapClone> PushNodeState<I, A>
impl<I: CheapClone, A: CheapClone> PushNodeState<I, A>
Sourcepub fn node(&self) -> Node<I, A>
pub fn node(&self) -> Node<I, A>
Returns a Node with the same id and address as this PushNodeState.
Trait Implementations§
Source§impl<I, A> Archive for PushNodeState<I, A>
impl<I, A> Archive for PushNodeState<I, A>
Source§type Archived = ArchivedPushNodeState<I, A>
type Archived = ArchivedPushNodeState<I, A>
Source§type Resolver = PushNodeStateResolver<I, A>
type Resolver = PushNodeStateResolver<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 PushNodeState<I, A>
impl<I: CheapClone, A: CheapClone> CheapClone for PushNodeState<I, A>
Source§fn cheap_clone(&self) -> Self
fn cheap_clone(&self) -> Self
Source§impl<I: Clone, A: Clone> Clone for PushNodeState<I, A>
impl<I: Clone, A: Clone> Clone for PushNodeState<I, A>
Source§fn clone(&self) -> PushNodeState<I, A>
fn clone(&self) -> PushNodeState<I, A>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'de, I, A> Deserialize<'de> for PushNodeState<I, A>where
I: Deserialize<'de>,
A: Deserialize<'de>,
impl<'de, I, A> Deserialize<'de> for PushNodeState<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<PushNodeState<I, A>, __D> for Archived<PushNodeState<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>,
u32: Archive,
<u32 as Archive>::Archived: Deserialize<u32, __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<PushNodeState<I, A>, __D> for Archived<PushNodeState<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>,
u32: Archive,
<u32 as Archive>::Archived: Deserialize<u32, __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§fn deserialize(
&self,
deserializer: &mut __D,
) -> Result<PushNodeState<I, A>, <__D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut __D, ) -> Result<PushNodeState<I, A>, <__D as Fallible>::Error>
Source§impl<I, A> PartialEq<ArchivedPushNodeState<I, A>> for PushNodeState<I, A>where
I: Archive,
A: Archive,
Meta: Archive,
u32: 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>,
<u32 as Archive>::Archived: PartialEq<u32>,
<State as Archive>::Archived: PartialEq<State>,
<ProtocolVersion as Archive>::Archived: PartialEq<ProtocolVersion>,
<DelegateVersion as Archive>::Archived: PartialEq<DelegateVersion>,
impl<I, A> PartialEq<ArchivedPushNodeState<I, A>> for PushNodeState<I, A>where
I: Archive,
A: Archive,
Meta: Archive,
u32: 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>,
<u32 as Archive>::Archived: PartialEq<u32>,
<State as Archive>::Archived: PartialEq<State>,
<ProtocolVersion as Archive>::Archived: PartialEq<ProtocolVersion>,
<DelegateVersion as Archive>::Archived: PartialEq<DelegateVersion>,
Source§impl<I, A> PartialEq<PushNodeState<I, A>> for ArchivedPushNodeState<I, A>where
I: Archive,
A: Archive,
Meta: Archive,
u32: 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>,
<u32 as Archive>::Archived: PartialEq<u32>,
<State as Archive>::Archived: PartialEq<State>,
<ProtocolVersion as Archive>::Archived: PartialEq<ProtocolVersion>,
<DelegateVersion as Archive>::Archived: PartialEq<DelegateVersion>,
impl<I, A> PartialEq<PushNodeState<I, A>> for ArchivedPushNodeState<I, A>where
I: Archive,
A: Archive,
Meta: Archive,
u32: 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>,
<u32 as Archive>::Archived: PartialEq<u32>,
<State as Archive>::Archived: PartialEq<State>,
<ProtocolVersion as Archive>::Archived: PartialEq<ProtocolVersion>,
<DelegateVersion as Archive>::Archived: PartialEq<DelegateVersion>,
Source§impl<I, A> Serialize for PushNodeState<I, A>
impl<I, A> Serialize for PushNodeState<I, A>
Source§impl<I: Transformable, A: Transformable> Transformable for PushNodeState<I, A>
impl<I: Transformable, A: Transformable> Transformable for PushNodeState<I, A>
Source§type Error = PushPullTransformError<I, A>
type Error = PushPullTransformError<I, A>
Source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Result<Vec<u8>, Self::Error>
fn encode_to_vec(&self) -> Result<Vec<u8>, Self::Error>
alloc or std only.Source§fn encode_to_writer<W>(&self, writer: &mut W) -> Result<usize, Error>where
W: Write,
fn encode_to_writer<W>(&self, writer: &mut W) -> Result<usize, Error>where
W: Write,
std only.Source§fn encode_to_async_writer<W>(
&self,
writer: &mut W,
) -> impl Future<Output = Result<usize, Error>> + Send
fn encode_to_async_writer<W>( &self, writer: &mut W, ) -> impl Future<Output = Result<usize, Error>> + Send
async only.impl<I: Eq, A: Eq> Eq for PushNodeState<I, A>
impl<I, A> StructuralPartialEq for PushNodeState<I, A>
Auto Trait Implementations§
impl<I, A> !Freeze for PushNodeState<I, A>
impl<I, A> RefUnwindSafe for PushNodeState<I, A>where
I: RefUnwindSafe,
A: RefUnwindSafe,
impl<I, A> Send for PushNodeState<I, A>
impl<I, A> Sync for PushNodeState<I, A>
impl<I, A> Unpin for PushNodeState<I, A>
impl<I, A> UnwindSafe for PushNodeState<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<T> Decodable for Twhere
T: Transformable,
impl<T> Decodable for Twhere
T: Transformable,
Source§type Error = <T as Transformable>::Error
type Error = <T as Transformable>::Error
Source§fn decode(src: &[u8]) -> Result<(usize, T), <T as Decodable>::Error>
fn decode(src: &[u8]) -> Result<(usize, T), <T as Decodable>::Error>
Source§impl<T> Encodable for Twhere
T: Transformable,
impl<T> Encodable for Twhere
T: Transformable,
Source§type Error = <T as Transformable>::Error
type Error = <T as Transformable>::Error
Source§fn encode(&self, dst: &mut [u8]) -> Result<usize, <T as Encodable>::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, <T as Encodable>::Error>
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode_to_vec(&self) -> Result<Vec<u8>, <T as Encodable>::Error>
fn encode_to_vec(&self) -> Result<Vec<u8>, <T as Encodable>::Error>
alloc or std only.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.