pub struct RelayDecision {
pub payload: Vec<u8>,
pub origin_node: NodeId,
pub hop_count: u8,
pub should_relay: bool,
pub relay_envelope: Option<RelayEnvelope>,
}Expand description
Decision from processing a relay envelope
Fields§
§payload: Vec<u8>The payload (document) to process locally
origin_node: NodeIdOriginal sender of the message
hop_count: u8Current hop count
should_relay: boolWhether this message should be relayed to other peers
relay_envelope: Option<RelayEnvelope>The relay envelope to forward (with incremented hop count)
Only present if should_relay is true and TTL not expired.
Implementations§
Source§impl RelayDecision
impl RelayDecision
Sourcepub fn relay_data(&self) -> Option<Vec<u8>>
pub fn relay_data(&self) -> Option<Vec<u8>>
Get the relay data to send to peers
Returns None if relay is not needed.
Trait Implementations§
Source§impl Clone for RelayDecision
impl Clone for RelayDecision
Source§fn clone(&self) -> RelayDecision
fn clone(&self) -> RelayDecision
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 moreAuto Trait Implementations§
impl Freeze for RelayDecision
impl RefUnwindSafe for RelayDecision
impl Send for RelayDecision
impl Sync for RelayDecision
impl Unpin for RelayDecision
impl UnsafeUnpin for RelayDecision
impl UnwindSafe for RelayDecision
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