Skip to main content

PushPull

Struct PushPull 

Source
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: bool

Whether the push pull message is a join message.

§states: Arc<[PushNodeState<I, A>]>

The states of the push pull message.

§user_data: Bytes

The user data of the push pull message.

Implementations§

Source§

impl<I, A> PushPull<I, A>

Source

pub const fn join(&self) -> bool

Returns whether the push pull message is a join message

Source

pub const fn states(&self) -> &Arc<[PushNodeState<I, A>]>

Returns the states of the push pull message

Source

pub const fn user_data(&self) -> &Bytes

Returns the user data of the push pull message

Source

pub const fn with_join(self, val: bool) -> PushPull<I, A>

Sets whether the push pull message is a join message (Builder pattern)

Source

pub fn with_states(self, val: Arc<[PushNodeState<I, A>]>) -> PushPull<I, A>

Sets the states of the push pull message (Builder pattern)

Source

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>

Source

pub fn new( join: bool, states: impl Iterator<Item = PushNodeState<I, A>>, ) -> PushPull<I, A>

Create a new PushPull message.

Source

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<I, A> Arbitrary for PushPull<I, A>
where I: Arbitrary, A: Arbitrary,

Source§

fn arbitrary(g: &mut Gen) -> PushPull<I, A>

Return an arbitrary value. Read more
Source§

fn shrink(&self) -> Box<dyn Iterator<Item = Self>>

Return an iterator of values that are smaller than itself. Read more
Source§

impl<'arbitrary, I, A> Arbitrary<'arbitrary> for PushPull<I, A>
where I: Arbitrary<'arbitrary>, A: Arbitrary<'arbitrary>,

Source§

fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<PushPull<I, A>, Error>

Generate an arbitrary value of Self from the given unstructured data. Read more
Source§

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 more
Source§

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 more
Source§

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 more
Source§

impl<I, A> CheapClone for PushPull<I, A>

Source§

fn cheap_clone(&self) -> PushPull<I, A>

Returns a copy of the value.
Source§

impl<I, A> Clone for PushPull<I, A>

Source§

fn clone(&self) -> PushPull<I, A>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<I, A> Data for PushPull<I, A>
where I: Data, A: Data,

Source§

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>
where PushPull<I, A>: Sized,

Converts the reference type to the owned type.
Source§

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>

Encodes the message to a buffer. Read more
Source§

const WIRE_TYPE: WireType = WireType::LengthDelimited

The wire type of the data.
Source§

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>

Available on crate features alloc or std only.
Encodes the message into a vec.
Source§

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>

Encodes the message with a length-delimiter to a buffer. Read more
Source§

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>

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,

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,

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>>
where I: Data, A: Data,

Source§

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,

Decodes a length-delimited reference instance of the message from the buffer.
Source§

impl<I, A> Debug for PushPull<I, A>
where I: Debug, A: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<I, A> Eq for PushPull<I, A>
where I: Eq, A: Eq,

Source§

impl<I, A> From<PushPull<I, A>> for Message<I, A>

Source§

fn from(value: PushPull<I, A>) -> Message<I, A>

Converts to this type from the input type.
Source§

impl<I, A> Hash for PushPull<I, A>
where I: Hash, A: Hash,

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<I, A> PartialEq for PushPull<I, A>
where I: PartialEq, A: PartialEq,

Source§

fn eq(&self, other: &PushPull<I, A>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<I, A> StructuralPartialEq for PushPull<I, A>
where I: PartialEq, A: PartialEq,

Auto Trait Implementations§

§

impl<I, A> !Freeze for PushPull<I, A>

§

impl<I, A> RefUnwindSafe for PushPull<I, A>

§

impl<I, A> Send for PushPull<I, A>
where I: Sync + Send, A: Sync + Send,

§

impl<I, A> Sync for PushPull<I, A>
where I: Sync + Send, A: Sync + Send,

§

impl<I, A> Unpin for PushPull<I, A>
where I: Unpin, A: Unpin,

§

impl<I, A> UnsafeUnpin for PushPull<I, A>

§

impl<I, A> UnwindSafe for PushPull<I, A>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more