pub struct PushPullMessage<I> {
pub ltime: LamportTime,
pub status_ltimes: IndexMap<I, LamportTime>,
pub left_members: IndexSet<I>,
pub event_ltime: LamportTime,
pub events: TinyVec<Option<UserEvents>>,
pub query_ltime: LamportTime,
}
Expand description
Used when doing a state exchange. This is a relatively large message, but is sent infrequently
Fields§
§ltime: LamportTime
Current node lamport time
status_ltimes: IndexMap<I, LamportTime>
Maps the node to its status time
left_members: IndexSet<I>
List of left nodes
event_ltime: LamportTime
Lamport time for event clock
events: TinyVec<Option<UserEvents>>
Recent events
query_ltime: LamportTime
Lamport time for query clock
Implementations§
Source§impl<I> PushPullMessage<I>
impl<I> PushPullMessage<I>
Sourcepub const fn ltime(&self) -> LamportTime
pub const fn ltime(&self) -> LamportTime
Returns the lamport time
Sourcepub const fn status_ltimes(&self) -> &IndexMap<I, LamportTime>
pub const fn status_ltimes(&self) -> &IndexMap<I, LamportTime>
Returns the maps the node to its status time
Sourcepub const fn left_members(&self) -> &IndexSet<I>
pub const fn left_members(&self) -> &IndexSet<I>
Returns the list of left nodes
Sourcepub const fn event_ltime(&self) -> LamportTime
pub const fn event_ltime(&self) -> LamportTime
Returns the lamport time for event clock
Sourcepub const fn events(&self) -> &TinyVec<Option<UserEvents>>
pub const fn events(&self) -> &TinyVec<Option<UserEvents>>
Returns the recent events
Sourcepub const fn query_ltime(&self) -> LamportTime
pub const fn query_ltime(&self) -> LamportTime
Returns the lamport time for query clock
Sourcepub const fn with_ltime(self, val: LamportTime) -> Self
pub const fn with_ltime(self, val: LamportTime) -> Self
Sets the lamport time (Builder pattern)
Sourcepub fn with_status_ltimes(self, val: IndexMap<I, LamportTime>) -> Self
pub fn with_status_ltimes(self, val: IndexMap<I, LamportTime>) -> Self
Sets the maps the node to its status time (Builder pattern)
Sourcepub fn with_left_members(self, val: IndexSet<I>) -> Self
pub fn with_left_members(self, val: IndexSet<I>) -> Self
Sets the list of left nodes (Builder pattern)
Sourcepub const fn with_event_ltime(self, val: LamportTime) -> Self
pub const fn with_event_ltime(self, val: LamportTime) -> Self
Sets the lamport time for event clock (Builder pattern)
Sourcepub fn with_events(self, val: TinyVec<Option<UserEvents>>) -> Self
pub fn with_events(self, val: TinyVec<Option<UserEvents>>) -> Self
Sets the recent events (Builder pattern)
Sourcepub const fn with_query_ltime(self, val: LamportTime) -> Self
pub const fn with_query_ltime(self, val: LamportTime) -> Self
Sets the lamport time for query clock (Builder pattern)
Trait Implementations§
Source§impl<I, A> AsMessageRef<I, A> for &PushPullMessage<I>
impl<I, A> AsMessageRef<I, A> for &PushPullMessage<I>
Source§fn as_message_ref(&self) -> SerfMessageRef<'_, I, A>
fn as_message_ref(&self) -> SerfMessageRef<'_, I, A>
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<I: Clone> Clone for PushPullMessage<I>
impl<I: Clone> Clone for PushPullMessage<I>
Source§fn clone(&self) -> PushPullMessage<I>
fn clone(&self) -> PushPullMessage<I>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<I: Debug> Debug for PushPullMessage<I>
impl<I: Debug> Debug for PushPullMessage<I>
Source§impl<'de, I> Deserialize<'de> for PushPullMessage<I>
impl<'de, I> Deserialize<'de> for PushPullMessage<I>
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a, I> From<&'a PushPullMessage<I>> for PushPullMessageRef<'a, I>
impl<'a, I> From<&'a PushPullMessage<I>> for PushPullMessageRef<'a, I>
Source§fn from(msg: &'a PushPullMessage<I>) -> Self
fn from(msg: &'a PushPullMessage<I>) -> Self
Converts to this type from the input type.
Source§impl<'a, I> From<&'a mut PushPullMessage<I>> for PushPullMessageRef<'a, I>
impl<'a, I> From<&'a mut PushPullMessage<I>> for PushPullMessageRef<'a, I>
Source§fn from(msg: &'a mut PushPullMessage<I>) -> Self
fn from(msg: &'a mut PushPullMessage<I>) -> Self
Converts to this type from the input type.
Source§impl<I> PartialEq for PushPullMessage<I>
impl<I> PartialEq for PushPullMessage<I>
Source§impl<I> Serialize for PushPullMessage<I>
impl<I> Serialize for PushPullMessage<I>
Source§impl<I> Transformable for PushPullMessage<I>
impl<I> Transformable for PushPullMessage<I>
Source§type Error = PushPullMessageTransformError<I>
type Error = PushPullMessageTransformError<I>
The error type returned when encoding or decoding fails.
Source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Encodes the value into the given buffer for transmission. Read more
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the value.
This is used to pre-allocate a buffer for encoding.
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,
Decodes the value from the given buffer received over the wire. Read more
Source§fn encode_to_vec(&self) -> Result<Vec<u8>, Self::Error>
fn encode_to_vec(&self) -> Result<Vec<u8>, Self::Error>
Encodes the value into a vec for transmission.
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,
Encodes the value into the given writer for transmission.
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
Encodes the value into the given async writer for transmission.
Auto Trait Implementations§
impl<I> !Freeze for PushPullMessage<I>
impl<I> RefUnwindSafe for PushPullMessage<I>where
I: RefUnwindSafe,
impl<I> Send for PushPullMessage<I>where
I: Send,
impl<I> Sync for PushPullMessage<I>where
I: Sync,
impl<I> Unpin for PushPullMessage<I>where
I: Unpin,
impl<I> UnwindSafe for PushPullMessage<I>where
I: UnwindSafe,
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<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
The error type returned when encoding or decoding fails.
Source§fn decode(src: &[u8]) -> Result<(usize, T), <T as Decodable>::Error>
fn decode(src: &[u8]) -> Result<(usize, T), <T as Decodable>::Error>
Decodes the value from the given buffer received over the wire. Read more
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
The error type returned when encoding or decoding fails.
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>
Encodes the value into the given buffer for transmission. Read more
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the value.
This is used to pre-allocate a buffer for encoding.
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>
Encodes the value into a vec for transmission.
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
Compare self to
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>
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 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>
Returns the layout of the type.
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
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out
indicating that a T
is niched.