pub enum InputMessage {
Premade {
msgs: Vec<MixPacket>,
lane: TransmissionLane,
},
Regular {
recipient: Recipient,
data: Vec<u8>,
lane: TransmissionLane,
max_retransmissions: Option<u32>,
},
Anonymous {
recipient: Recipient,
data: Vec<u8>,
reply_surbs: u32,
lane: TransmissionLane,
max_retransmissions: Option<u32>,
},
Reply {
recipient_tag: AnonymousSenderTag,
data: Vec<u8>,
lane: TransmissionLane,
max_retransmissions: Option<u32>,
},
MessageWrapper {
message: Box<InputMessage>,
packet_type: PacketType,
},
}Variants§
Premade
Fire an already prepared mix packets into the network. No guarantees are made about it. For example no retransmssion will be attempted if it gets dropped.
Regular
The simplest message variant where no additional information is attached.
You’re simply sending your data to specified recipient without any tagging.
Ends up with NymMessage::Plain variant
Anonymous
Creates a message used for a duplex anonymous communication where the recipient
will never learn of our true identity. This is achieved by carefully sending reply_surbs.
Note that if reply_surbs is set to zero then this variant requires the client having sent some reply_surbs in the past (and thus the recipient also knowing our sender tag).
Ends up with NymMessage::Repliable variant
Fields
lane: TransmissionLaneReply
Attempt to use our internally received and stored ReplySurb to send the message back
to specified recipient whilst not knowing its full identity (or even gateway).
Ends up with NymMessage::Reply variant
MessageWrapper
Implementations§
Source§impl InputMessage
impl InputMessage
pub fn new_premade( msgs: Vec<MixPacket>, lane: TransmissionLane, packet_type: PacketType, ) -> Self
pub fn new_wrapper(message: InputMessage, packet_type: PacketType) -> Self
pub fn new_regular( recipient: Recipient, data: Vec<u8>, lane: TransmissionLane, packet_type: Option<PacketType>, ) -> Self
pub fn new_anonymous( recipient: Recipient, data: Vec<u8>, reply_surbs: u32, lane: TransmissionLane, packet_type: Option<PacketType>, ) -> Self
pub fn new_reply( recipient_tag: AnonymousSenderTag, data: Vec<u8>, lane: TransmissionLane, packet_type: Option<PacketType>, ) -> Self
pub fn lane(&self) -> &TransmissionLane
pub fn set_max_retransmissions(&mut self, max_retransmissions: u32) -> &mut Self
pub fn with_max_retransmissions(self, max_retransmissions: u32) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InputMessage
impl RefUnwindSafe for InputMessage
impl Send for InputMessage
impl Sync for InputMessage
impl Unpin for InputMessage
impl UnwindSafe for InputMessage
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
Source§impl<T> Deprecatable for T
impl<T> Deprecatable for T
fn deprecate(self) -> Deprecated<Self>where
Self: Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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> OptionalSet for T
impl<T> OptionalSet for T
Source§fn with_optional<F, T>(self, f: F, val: Option<T>) -> Self
fn with_optional<F, T>(self, f: F, val: Option<T>) -> Self
Some), the provided closure is applied.
Otherwise self is returned with no modifications.Source§fn with_validated_optional<F, T, V, E>(
self,
f: F,
value: Option<T>,
validate: V,
) -> Result<Self, E>
fn with_validated_optional<F, T, V, E>( self, f: F, value: Option<T>, validate: V, ) -> Result<Self, E>
Some) it is validated and then the provided closure is applied.
Otherwise self is returned with no modifications.Source§fn with_optional_env<F, T>(self, f: F, val: Option<T>, env_var: &str) -> Self
fn with_optional_env<F, T>(self, f: F, val: Option<T>, env_var: &str) -> Self
Some), the provided closure is applied.
Otherwise, if the environment was configured and the corresponding variable was set,
the value is parsed using the FromStr implementation and the closure is applied on that instead.
Finally, if none of those were available, self is returned with no modifications.Source§fn with_optional_custom_env<F, T, G>(
self,
f: F,
val: Option<T>,
env_var: &str,
parser: G,
) -> Self
fn with_optional_custom_env<F, T, G>( self, f: F, val: Option<T>, env_var: &str, parser: G, ) -> Self
Some), the provided closure is applied.
Otherwise, if the environment was configured and the corresponding variable was set,
the value is parsed using the provided parser and the closure is applied on that instead.
Finally, if none of those were available, self is returned with no modifications.