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_id(self, val: I) -> PushNodeState<I, A>
pub fn with_id(self, val: I) -> PushNodeState<I, A>
Sets the id of the push node state (Builder pattern)
Sourcepub fn with_address(self, val: A) -> PushNodeState<I, A>
pub fn with_address(self, val: A) -> PushNodeState<I, A>
Sets the address of the push node state (Builder pattern)
Sourcepub fn with_meta(self, val: Meta) -> PushNodeState<I, A>
pub fn with_meta(self, val: Meta) -> PushNodeState<I, A>
Sets the meta of the push node state (Builder pattern)
Sourcepub const fn with_incarnation(self, val: u32) -> PushNodeState<I, A>
pub const fn with_incarnation(self, val: u32) -> PushNodeState<I, A>
Sets the incarnation of the push node state (Builder pattern)
Sourcepub const fn with_state(self, val: State) -> PushNodeState<I, A>
pub const fn with_state(self, val: State) -> PushNodeState<I, A>
Sets the state of the push node state (Builder pattern)
Sourcepub const fn with_protocol_version(
self,
val: ProtocolVersion,
) -> PushNodeState<I, A>
pub const fn with_protocol_version( self, val: ProtocolVersion, ) -> PushNodeState<I, A>
Sets the protocol version of the push node state is speaking (Builder pattern)
Sourcepub const fn with_delegate_version(
self,
val: DelegateVersion,
) -> PushNodeState<I, A>
pub const fn with_delegate_version( self, val: DelegateVersion, ) -> PushNodeState<I, A>
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,
) -> PushNodeState<I, A>
pub const fn new( incarnation: u32, id: I, addr: A, state: State, ) -> PushNodeState<I, A>
Construct a new push node state with the given id, address and state.
Sourcepub fn set_id(&mut self, id: I) -> &mut PushNodeState<I, A>
pub fn set_id(&mut self, id: I) -> &mut PushNodeState<I, A>
Sets the id of the push node state
Sourcepub fn set_address(&mut self, addr: A) -> &mut PushNodeState<I, A>
pub fn set_address(&mut self, addr: A) -> &mut PushNodeState<I, A>
Sets the address of the push node state
Sourcepub fn set_meta(&mut self, meta: Meta) -> &mut PushNodeState<I, A>
pub fn set_meta(&mut self, meta: Meta) -> &mut PushNodeState<I, A>
Sets the meta of the push node state
Sourcepub fn set_incarnation(&mut self, incarnation: u32) -> &mut PushNodeState<I, A>
pub fn set_incarnation(&mut self, incarnation: u32) -> &mut PushNodeState<I, A>
Sets the incarnation of the push node state
Sourcepub fn set_state(&mut self, state: State) -> &mut PushNodeState<I, A>
pub fn set_state(&mut self, state: State) -> &mut PushNodeState<I, A>
Sets the state of the push node state
Sourcepub fn set_protocol_version(
&mut self,
protocol_version: ProtocolVersion,
) -> &mut PushNodeState<I, A>
pub fn set_protocol_version( &mut self, protocol_version: ProtocolVersion, ) -> &mut PushNodeState<I, A>
Sets the protocol version of the push node state
Sourcepub fn set_delegate_version(
&mut self,
delegate_version: DelegateVersion,
) -> &mut PushNodeState<I, A>
pub fn set_delegate_version( &mut self, delegate_version: DelegateVersion, ) -> &mut PushNodeState<I, A>
Sets the delegate version of the push node state
Source§impl<I, A> PushNodeState<I, A>where
I: CheapClone,
A: CheapClone,
impl<I, A> PushNodeState<I, A>where
I: CheapClone,
A: CheapClone,
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> Arbitrary for PushNodeState<I, A>
impl<I, A> Arbitrary for PushNodeState<I, A>
Source§impl<'arbitrary, I, A> Arbitrary<'arbitrary> for PushNodeState<I, A>
impl<'arbitrary, I, A> Arbitrary<'arbitrary> for PushNodeState<I, A>
Source§fn arbitrary(
u: &mut Unstructured<'arbitrary>,
) -> Result<PushNodeState<I, A>, Error>
fn arbitrary( u: &mut Unstructured<'arbitrary>, ) -> Result<PushNodeState<I, A>, Error>
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(
u: Unstructured<'arbitrary>,
) -> Result<PushNodeState<I, A>, Error>
fn arbitrary_take_rest( u: Unstructured<'arbitrary>, ) -> Result<PushNodeState<I, A>, Error>
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured this type
needs to construct itself. Read moreSource§impl<I, A> CheapClone for PushNodeState<I, A>where
I: CheapClone,
A: CheapClone,
impl<I, A> CheapClone for PushNodeState<I, A>where
I: CheapClone,
A: CheapClone,
Source§fn cheap_clone(&self) -> PushNodeState<I, A>
fn cheap_clone(&self) -> PushNodeState<I, A>
Source§impl<I, A> Clone for PushNodeState<I, A>
impl<I, A> Clone for PushNodeState<I, A>
Source§fn clone(&self) -> PushNodeState<I, A>
fn clone(&self) -> PushNodeState<I, A>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<I, A> Data for PushNodeState<I, A>
impl<I, A> Data for PushNodeState<I, A>
Source§type Ref<'a> = PushNodeStateRef<'a, <I as Data>::Ref<'a>, <A as Data>::Ref<'a>>
type Ref<'a> = PushNodeStateRef<'a, <I as Data>::Ref<'a>, <A as Data>::Ref<'a>>
Source§fn from_ref(
val: <PushNodeState<I, A> as Data>::Ref<'_>,
) -> Result<PushNodeState<I, A>, DecodeError>
fn from_ref( val: <PushNodeState<I, A> as Data>::Ref<'_>, ) -> Result<PushNodeState<I, A>, DecodeError>
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut [u8]) -> Result<usize, EncodeError>
fn encode(&self, buf: &mut [u8]) -> Result<usize, EncodeError>
Source§fn encoded_len_with_length_delimited(&self) -> usize
fn encoded_len_with_length_delimited(&self) -> usize
Source§fn encode_to_vec(&self) -> Result<Vec<u8>, EncodeError>
fn encode_to_vec(&self) -> Result<Vec<u8>, EncodeError>
alloc or std only.Source§fn encode_to_bytes(&self) -> Result<Bytes, EncodeError>
fn encode_to_bytes(&self) -> Result<Bytes, EncodeError>
alloc or std only.Bytes.Source§fn encode_length_delimited(&self, buf: &mut [u8]) -> Result<usize, EncodeError>
fn encode_length_delimited(&self, buf: &mut [u8]) -> Result<usize, EncodeError>
Source§fn encode_length_delimited_to_vec(&self) -> Result<Vec<u8>, EncodeError>
fn encode_length_delimited_to_vec(&self) -> Result<Vec<u8>, EncodeError>
alloc or std only.Source§fn encode_length_delimited_to_bytes(&self) -> Result<Bytes, EncodeError>
fn encode_length_delimited_to_bytes(&self) -> Result<Bytes, EncodeError>
alloc or std only.Bytes.Source§fn decode(src: &[u8]) -> Result<(usize, Self), DecodeError>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), DecodeError>where
Self: Sized,
Source§fn decode_length_delimited(buf: &[u8]) -> Result<(usize, Self), DecodeError>where
Self: Sized,
fn decode_length_delimited(buf: &[u8]) -> Result<(usize, Self), DecodeError>where
Self: Sized,
Source§impl<'a, I, A> DataRef<'a, PushNodeState<I, A>> for PushNodeStateRef<'a, <I as Data>::Ref<'a>, <A as Data>::Ref<'a>>
impl<'a, I, A> DataRef<'a, PushNodeState<I, A>> for PushNodeStateRef<'a, <I as Data>::Ref<'a>, <A as Data>::Ref<'a>>
Source§fn decode(
src: &'a [u8],
) -> Result<(usize, PushNodeStateRef<'a, <I as Data>::Ref<'a>, <A as Data>::Ref<'a>>), DecodeError>
fn decode( src: &'a [u8], ) -> Result<(usize, PushNodeStateRef<'a, <I as Data>::Ref<'a>, <A as Data>::Ref<'a>>), DecodeError>
Source§fn decode_length_delimited(src: &'a [u8]) -> Result<(usize, Self), DecodeError>where
Self: Sized,
fn decode_length_delimited(src: &'a [u8]) -> Result<(usize, Self), DecodeError>where
Self: Sized,
Source§impl<I, A> Debug for PushNodeState<I, A>
impl<I, A> Debug for PushNodeState<I, A>
Source§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<PushNodeState<I, A>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PushNodeState<I, A>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl<I, A> Eq for PushNodeState<I, A>
Source§impl<I, A> Hash for PushNodeState<I, A>
impl<I, A> Hash for PushNodeState<I, A>
Source§impl<I, A> PartialEq for PushNodeState<I, A>
impl<I, A> PartialEq for PushNodeState<I, A>
Source§fn eq(&self, other: &PushNodeState<I, A>) -> bool
fn eq(&self, other: &PushNodeState<I, A>) -> bool
self and other values to be equal, and is used by ==.Source§impl<I, A> Serialize for PushNodeState<I, A>
impl<I, A> Serialize for PushNodeState<I, A>
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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> UnsafeUnpin for PushNodeState<I, A>where
I: UnsafeUnpin,
A: UnsafeUnpin,
impl<I, A> UnwindSafe for PushNodeState<I, A>where
I: UnwindSafe,
A: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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<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> 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 more