pub struct SendOptions {
pub mic_size: MicSize,
pub encrypted: bool,
pub ack_requested: bool,
pub full_source: bool,
pub flood_hops: Option<u8>,
pub trace_route: bool,
pub source_route: Option<Vec<RouterHint, MAX_SOURCE_ROUTE_HOPS>>,
pub region_code: Option<[u8; 2]>,
pub salt: bool,
}Expand description
High-level transmission options passed to Mac send helpers.
SendOptions expresses what the application wants from a send — the coordinator
translates these into packet-builder calls and enforces any
OperatingPolicy constraints before building the frame.
The default configuration (SendOptions::default()) is a reasonable starting point:
16-byte MIC, encryption enabled, no ACK, 3-byte source hint, 5 flood hops, no trace
route, no salt.
SendOptions exposes a fluent builder API so applications can override only what they
care about:
let opts = SendOptions::default()
.with_ack_requested(true)
.with_mic_size(MicSize::Mic8)
.no_flood()
.with_trace_route();§Field notes
mic_size— trading MIC length against frame overhead. 16-byte MIC is strongly preferred for unicast; 4-byte may be acceptable for low-bandwidth broadcast beacons.flood_hops—Nonedisables flood forwarding (point-to-point or source-routed only).Some(n)sets the initialFHOPS_REMbudget; repeaters decrement it and drop at zero.full_source— include the full 32-byte public key instead of the 3-byte hint, allowing the receiver to authenticate without a prior key exchange. Useful for first contact or identity announcements; costs 29 extra bytes per frame.salt— append a random 2-byte salt to SECINFO, adding nonce diversity and preventing correlation of frames sharing the same counter value across sessions.source_route— provide an explicit list ofRouterHintvalues to route the frame along a known path rather than relying on flood forwarding. Setting a source route also constrains the flood-hop budget to the route length whenflood_hopsis unset.
Fields§
§mic_size: MicSizeRequested MIC size.
encrypted: boolWhether the payload should be encrypted when supported.
ack_requested: boolWhether a transport ACK should be requested.
full_source: boolWhether to encode the full source public key.
flood_hops: Option<u8>Optional flood-hop budget.
trace_route: boolWhether to include a trace-route option.
source_route: Option<Vec<RouterHint, MAX_SOURCE_ROUTE_HOPS>>Optional explicit source route.
region_code: Option<[u8; 2]>Optional region-code option.
salt: boolWhether to include a random salt in SECINFO.
Implementations§
Source§impl SendOptions
impl SendOptions
Sourcepub fn with_mic_size(self, mic_size: MicSize) -> Self
pub fn with_mic_size(self, mic_size: MicSize) -> Self
Override the MIC size.
Sourcepub fn with_ack_requested(self, value: bool) -> Self
pub fn with_ack_requested(self, value: bool) -> Self
Set whether the send should request an ACK.
Sourcepub fn with_flood_hops(self, hops: u8) -> Self
pub fn with_flood_hops(self, hops: u8) -> Self
Set the flood-hop budget.
Sourcepub fn with_trace_route(self) -> Self
pub fn with_trace_route(self) -> Self
Request that a trace-route option be added.
Sourcepub fn try_with_source_route(
self,
route: &[RouterHint],
) -> Result<Self, CapacityError>
pub fn try_with_source_route( self, route: &[RouterHint], ) -> Result<Self, CapacityError>
Copy a source route into fixed-capacity storage.
Sourcepub fn with_full_source(self) -> Self
pub fn with_full_source(self) -> Self
Force the source address to use the full public key.
Sourcepub fn unencrypted(self) -> Self
pub fn unencrypted(self) -> Self
Disable encryption for this send.
Sourcepub fn with_region_code(self, code: [u8; 2]) -> Self
pub fn with_region_code(self, code: [u8; 2]) -> Self
Set the region-code option.
Trait Implementations§
Source§impl Clone for SendOptions
impl Clone for SendOptions
Source§fn clone(&self) -> SendOptions
fn clone(&self) -> SendOptions
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SendOptions
impl Debug for SendOptions
Source§impl Default for SendOptions
impl Default for SendOptions
Source§impl PartialEq for SendOptions
impl PartialEq for SendOptions
impl Eq for SendOptions
impl StructuralPartialEq for SendOptions
Auto Trait Implementations§
impl Freeze for SendOptions
impl RefUnwindSafe for SendOptions
impl Send for SendOptions
impl Sync for SendOptions
impl Unpin for SendOptions
impl UnwindSafe for SendOptions
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)