BroadcastBuilder

Type Alias BroadcastBuilder 

Source
pub type BroadcastBuilder<'a, S> = Builder<'a, BroadcastKind, S>;
Expand description

Broadcast packet builder alias.

Aliased Type§

pub struct BroadcastBuilder<'a, S> { /* private fields */ }

Implementations§

Source§

impl<'a> BroadcastBuilder<'a, NeedsSource>

Source

pub fn source_hint(self, hint: NodeHint) -> BroadcastBuilder<'a, Configuring>

Encode the source address as a three-byte hint.

Source

pub fn source_full(self, key: &PublicKey) -> BroadcastBuilder<'a, Configuring>

Encode the source address as a full public key.

Source§

impl<'a> BroadcastBuilder<'a, Configuring>

Source

pub fn flood_hops(self, remaining: u8) -> Self

Set the initial flood-hop budget.

Source

pub fn region_code(self, code: [u8; 2]) -> Self

Add the region-code option.

Source

pub fn trace_route(self) -> Self

Add an empty trace-route option.

Source

pub fn trace_signal(self) -> Self

Add an empty trace-signal option. Pairs entry-for-entry with trace route, so it is only meaningful alongside it.

Source

pub fn source_route(self, hops: &[RouterHint]) -> Self

Add a source-route option from a router-hint slice.

Source

pub fn option(self, number: OptionNumber, value: &[u8]) -> Self

Add an arbitrary option number/value pair.

Source§

impl<'a> BroadcastBuilder<'a, Configuring>

Source

pub fn payload(self, data: &[u8]) -> BroadcastBuilder<'a, Complete>

Stage a broadcast payload.

Source

pub fn build(self) -> Result<&'a [u8], BuildError>

Finalize the broadcast packet and return the written frame bytes.

Layout: FCF [FHOPS] SRC OPTIONS [0xFF PAYLOAD]

Source§

impl<'a> BroadcastBuilder<'a, Complete>

Source

pub fn build(self) -> Result<&'a [u8], BuildError>

Finalize the broadcast packet and return the written frame bytes.