pub struct Vote<T: NetworkEvent, P: PublicId> { /* private fields */ }Expand description
A helper struct carrying an Observation and a signature of this Observation.
Implementations§
Source§impl<T: NetworkEvent, P: PublicId> Vote<T, P>
impl<T: NetworkEvent, P: PublicId> Vote<T, P>
Sourcepub fn new<S: SecretId<PublicId = P>>(
secret_id: &S,
payload: Observation<T, P>,
) -> Self
pub fn new<S: SecretId<PublicId = P>>( secret_id: &S, payload: Observation<T, P>, ) -> Self
Creates a Vote for payload.
Sourcepub fn payload(&self) -> &Observation<T, P>
pub fn payload(&self) -> &Observation<T, P>
Returns the payload being voted for.
Trait Implementations§
Source§impl<'de, T, P: PublicId> Deserialize<'de> for Vote<T, P>where
T: DeserializeOwned + NetworkEvent,
impl<'de, T, P: PublicId> Deserialize<'de> for Vote<T, P>where
T: DeserializeOwned + NetworkEvent,
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<T: Ord + NetworkEvent, P: Ord + PublicId> Ord for Vote<T, P>
impl<T: Ord + NetworkEvent, P: Ord + PublicId> Ord for Vote<T, P>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialOrd + NetworkEvent, P: PartialOrd + PublicId> PartialOrd for Vote<T, P>where
P::Signature: PartialOrd,
impl<T: PartialOrd + NetworkEvent, P: PartialOrd + PublicId> PartialOrd for Vote<T, P>where
P::Signature: PartialOrd,
impl<T: Eq + NetworkEvent, P: Eq + PublicId> Eq for Vote<T, P>
impl<T: NetworkEvent, P: PublicId> StructuralPartialEq for Vote<T, P>
Auto Trait Implementations§
impl<T, P> Freeze for Vote<T, P>
impl<T, P> RefUnwindSafe for Vote<T, P>
impl<T, P> Send for Vote<T, P>
impl<T, P> Sync for Vote<T, P>
impl<T, P> Unpin for Vote<T, P>
impl<T, P> UnsafeUnpin for Vote<T, P>
impl<T, P> UnwindSafe for Vote<T, P>
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