pub struct PushPull<I, A> {
pub join: bool,
pub states: Arc<[PushNodeState<I, A>]>,
pub user_data: Bytes,
}Expand description
Push pull message.
Fields§
§join: boolWhether the push pull message is a join message.
states: Arc<[PushNodeState<I, A>]>The states of the push pull message.
user_data: BytesThe user data of the push pull message.
Implementations§
Source§impl<I, A> PushPull<I, A>
impl<I, A> PushPull<I, A>
Sourcepub const fn states(&self) -> &Arc<[PushNodeState<I, A>]>
pub const fn states(&self) -> &Arc<[PushNodeState<I, A>]>
Returns the states of the push pull message
Sourcepub const fn with_join(self, val: bool) -> PushPull<I, A>
pub const fn with_join(self, val: bool) -> PushPull<I, A>
Sets whether the push pull message is a join message (Builder pattern)
Sourcepub fn with_states(self, val: Arc<[PushNodeState<I, A>]>) -> PushPull<I, A>
pub fn with_states(self, val: Arc<[PushNodeState<I, A>]>) -> PushPull<I, A>
Sets the states of the push pull message (Builder pattern)
Sourcepub fn with_user_data(self, val: Bytes) -> PushPull<I, A>
pub fn with_user_data(self, val: Bytes) -> PushPull<I, A>
Sets the user data of the push pull message (Builder pattern)
Source§impl<I, A> PushPull<I, A>
impl<I, A> PushPull<I, A>
Sourcepub fn new(
join: bool,
states: impl Iterator<Item = PushNodeState<I, A>>,
) -> PushPull<I, A>
pub fn new( join: bool, states: impl Iterator<Item = PushNodeState<I, A>>, ) -> PushPull<I, A>
Create a new PushPull message.
Sourcepub fn into_components(self) -> (bool, Bytes, Arc<[PushNodeState<I, A>]>)
pub fn into_components(self) -> (bool, Bytes, Arc<[PushNodeState<I, A>]>)
Consumes the PushPull and returns the states and user data.
Trait Implementations§
Source§impl<'arbitrary, I, A> Arbitrary<'arbitrary> for PushPull<I, A>
impl<'arbitrary, I, A> Arbitrary<'arbitrary> for PushPull<I, A>
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<PushPull<I, A>, Error>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<PushPull<I, A>, Error>
Generate an arbitrary value of
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(
u: Unstructured<'arbitrary>,
) -> Result<PushPull<I, A>, Error>
fn arbitrary_take_rest( u: Unstructured<'arbitrary>, ) -> Result<PushPull<I, A>, Error>
Generate an arbitrary value of
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>)
Get a size hint for how many bytes out of an
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>
Get a size hint for how many bytes out of an
Unstructured this type
needs to construct itself. Read moreSource§impl<I, A> CheapClone for PushPull<I, A>
impl<I, A> CheapClone for PushPull<I, A>
Source§fn cheap_clone(&self) -> PushPull<I, A>
fn cheap_clone(&self) -> PushPull<I, A>
Returns a copy of the value.
Source§impl<I, A> Data for PushPull<I, A>
impl<I, A> Data for PushPull<I, A>
Source§type Ref<'a> = PushPullRef<'a, <I as Data>::Ref<'a>, <A as Data>::Ref<'a>>
type Ref<'a> = PushPullRef<'a, <I as Data>::Ref<'a>, <A as Data>::Ref<'a>>
The reference type of the data.
Source§fn from_ref(
val: <PushPull<I, A> as Data>::Ref<'_>,
) -> Result<PushPull<I, A>, DecodeError>
fn from_ref( val: <PushPull<I, A> as Data>::Ref<'_>, ) -> Result<PushPull<I, A>, DecodeError>
Converts the reference type to the owned type.
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the data only considering the data itself, (e.g. no length prefix, no wire type).
Source§fn encode(&self, buf: &mut [u8]) -> Result<usize, EncodeError>
fn encode(&self, buf: &mut [u8]) -> Result<usize, EncodeError>
Encodes the message to a buffer. Read more
Source§fn encoded_len_with_length_delimited(&self) -> usize
fn encoded_len_with_length_delimited(&self) -> usize
Returns the encoded length of the data including the length delimited.
Source§fn encode_to_vec(&self) -> Result<Vec<u8>, EncodeError>
fn encode_to_vec(&self) -> Result<Vec<u8>, EncodeError>
Available on crate features
alloc or std only.Encodes the message into a vec.
Source§fn encode_to_bytes(&self) -> Result<Bytes, EncodeError>
fn encode_to_bytes(&self) -> Result<Bytes, EncodeError>
Available on crate features
alloc or std only.Encodes the message into a
Bytes.Source§fn encode_length_delimited(&self, buf: &mut [u8]) -> Result<usize, EncodeError>
fn encode_length_delimited(&self, buf: &mut [u8]) -> Result<usize, EncodeError>
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn encode_length_delimited_to_vec(&self) -> Result<Vec<u8>, EncodeError>
fn encode_length_delimited_to_vec(&self) -> Result<Vec<u8>, EncodeError>
Available on crate features
alloc or std only.Encodes the message with a length-delimiter into a vec.
Source§fn encode_length_delimited_to_bytes(&self) -> Result<Bytes, EncodeError>
fn encode_length_delimited_to_bytes(&self) -> Result<Bytes, EncodeError>
Available on crate features
alloc or std only.Encodes the message with a length-delimiter into a
Bytes.Source§fn decode(src: &[u8]) -> Result<(usize, Self), DecodeError>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), DecodeError>where
Self: Sized,
Decodes an instance of the message from a buffer. Read more
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,
Decodes a length-delimited instance of the message from the buffer.
Source§impl<'a, I, A> DataRef<'a, PushPull<I, A>> for PushPullRef<'a, <I as Data>::Ref<'a>, <A as Data>::Ref<'a>>
impl<'a, I, A> DataRef<'a, PushPull<I, A>> for PushPullRef<'a, <I as Data>::Ref<'a>, <A as Data>::Ref<'a>>
Source§fn decode(
src: &'a [u8],
) -> Result<(usize, PushPullRef<'a, <I as Data>::Ref<'a>, <A as Data>::Ref<'a>>), DecodeError>
fn decode( src: &'a [u8], ) -> Result<(usize, PushPullRef<'a, <I as Data>::Ref<'a>, <A as Data>::Ref<'a>>), DecodeError>
Decodes the reference type from a buffer. Read more
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,
Decodes a length-delimited reference instance of the message from the buffer.
impl<I, A> Eq for PushPull<I, A>
Source§impl<I, A> PartialEq for PushPull<I, A>
impl<I, A> PartialEq for PushPull<I, A>
impl<I, A> StructuralPartialEq for PushPull<I, A>
Auto Trait Implementations§
impl<I, A> !Freeze for PushPull<I, A>
impl<I, A> RefUnwindSafe for PushPull<I, A>where
I: RefUnwindSafe,
A: RefUnwindSafe,
impl<I, A> Send for PushPull<I, A>
impl<I, A> Sync for PushPull<I, A>
impl<I, A> Unpin for PushPull<I, A>
impl<I, A> UnsafeUnpin for PushPull<I, A>
impl<I, A> UnwindSafe for PushPull<I, A>where
I: RefUnwindSafe,
A: RefUnwindSafe,
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,
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> 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 more