Skip to main content

Suspect

Struct Suspect 

Source
pub struct Suspect<I> {
    pub incarnation: u32,
    pub node: I,
    pub from: I,
}
Expand description

Suspect message

Fields§

§incarnation: u32

The incarnation of the message.

§node: I

The node of the message.

§from: I

The source node of the message.

Implementations§

Source§

impl<I> Suspect<I>

Source

pub const fn incarnation(&self) -> u32

Returns the incarnation of the message

Source

pub const fn node(&self) -> &I

Returns the node of the message

Source

pub const fn from(&self) -> &I

Returns the source node of the message

Source

pub const fn with_incarnation(self, val: u32) -> Suspect<I>

Sets the incarnation of the message (Builder pattern)

Source

pub fn with_node(self, val: I) -> Suspect<I>

Sets the node of the message (Builder pattern)

Source

pub fn with_from(self, val: I) -> Suspect<I>

Sets the source node of the message (Builder pattern)

Source§

impl<I> Suspect<I>

Source

pub const fn new(incarnation: u32, node: I, from: I) -> Suspect<I>

Create a new message

Source

pub fn set_incarnation(&mut self, incarnation: u32) -> &mut Suspect<I>

Sets the incarnation of the message

Source

pub fn set_from(&mut self, source: I) -> &mut Suspect<I>

Sets the source node of the message

Source

pub fn set_node(&mut self, target: I) -> &mut Suspect<I>

Sets the node which in this state

Trait Implementations§

Source§

impl<I> Arbitrary for Suspect<I>
where I: Arbitrary,

Source§

fn arbitrary(g: &mut Gen) -> Suspect<I>

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> Arbitrary<'arbitrary> for Suspect<I>
where I: Arbitrary<'arbitrary>,

Source§

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

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

fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Suspect<I>, 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> Clone for Suspect<I>
where I: Clone,

Source§

fn clone(&self) -> Suspect<I>

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> Copy for Suspect<I>
where I: Copy,

Source§

impl<I> Data for Suspect<I>
where I: Data,

Source§

type Ref<'a> = Suspect<<I as Data>::Ref<'a>>

The reference type of the data.
Source§

fn from_ref( val: <Suspect<I> as Data>::Ref<'_>, ) -> Result<Suspect<I>, DecodeError>

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> DataRef<'a, Suspect<I>> for Suspect<<I as Data>::Ref<'a>>
where I: Data,

Source§

fn decode( src: &'a [u8], ) -> Result<(usize, Suspect<<I as Data>::Ref<'a>>), DecodeError>
where Suspect<<I as Data>::Ref<'a>>: Sized,

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> Debug for Suspect<I>
where I: Debug,

Source§

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

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

impl<'de, I> Deserialize<'de> for Suspect<I>
where I: Deserialize<'de>,

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Suspect<I>, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<I> Eq for Suspect<I>
where I: Eq,

Source§

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

Source§

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

Converts to this type from the input type.
Source§

impl<'a, I, A> From<Suspect<I>> for MessageRef<'a, I, A>

Source§

fn from(value: Suspect<I>) -> MessageRef<'a, I, A>

Converts to this type from the input type.
Source§

impl<I> Hash for Suspect<I>
where I: 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> PartialEq for Suspect<I>
where I: PartialEq,

Source§

fn eq(&self, other: &Suspect<I>) -> 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> Serialize for Suspect<I>
where I: Serialize,

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<I> StructuralPartialEq for Suspect<I>
where I: PartialEq,

Auto Trait Implementations§

§

impl<I> Freeze for Suspect<I>
where I: Freeze,

§

impl<I> RefUnwindSafe for Suspect<I>
where I: RefUnwindSafe,

§

impl<I> Send for Suspect<I>
where I: Send,

§

impl<I> Sync for Suspect<I>
where I: Sync,

§

impl<I> Unpin for Suspect<I>
where I: Unpin,

§

impl<I> UnsafeUnpin for Suspect<I>
where I: UnsafeUnpin,

§

impl<I> UnwindSafe for Suspect<I>
where I: UnwindSafe,

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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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