pub struct Message {
pub from_party_id: String,
pub to_party_id: Option<String>,
pub round: u8,
pub payload: Vec<u8>,
}Expand description
A single inter-party message belonging to one round of a session.
from_party_id and to_party_id are the canonical ASCII party ids
from crate::party::Party. to_party_id == None means broadcast
— every other party should process this message. round is the
1-indexed round number the message belongs to; payload is the
scheme-specific wire bytes (commitments, signature shares, etc.).
Fields§
§from_party_id: String§to_party_id: Option<String>§round: u8§payload: Vec<u8>Implementations§
Source§impl Message
impl Message
Sourcepub fn directed(
from: impl Into<String>,
to: impl Into<String>,
round: u8,
payload: impl Into<Vec<u8>>,
) -> Self
pub fn directed( from: impl Into<String>, to: impl Into<String>, round: u8, payload: impl Into<Vec<u8>>, ) -> Self
Build a directed (point-to-point) message.
Sourcepub fn broadcast(
from: impl Into<String>,
round: u8,
payload: impl Into<Vec<u8>>,
) -> Self
pub fn broadcast( from: impl Into<String>, round: u8, payload: impl Into<Vec<u8>>, ) -> Self
Build a broadcast message — addressed to every other party.
Sourcepub fn is_broadcast(&self) -> bool
pub fn is_broadcast(&self) -> bool
True when this message is addressed to every party.
Sourcepub fn is_directed(&self) -> bool
pub fn is_directed(&self) -> bool
True when this message is directed at exactly one party.
Trait Implementations§
impl Eq for Message
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnsafeUnpin for Message
impl UnwindSafe for Message
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