pub struct Announcement {
pub kind: AnnouncementKind,
pub flood_hops: u8,
pub full_source: bool,
pub channel: Option<[u8; 16]>,
}Expand description
A parsed CMD_ANNOUNCE request, with absent options resolved to
their defaults.
Fields§
§kind: AnnouncementKind§flood_hops: u8The flood budget. Zero reaches only nodes that hear the device directly.
full_source: boolWhether SRC carries the full public key.
channel: Option<[u8; 16]>The channel to send on, named by its full channel identifier.
None is a broadcast.
Implementations§
Source§impl Announcement
impl Announcement
Sourcepub const fn new(kind: AnnouncementKind) -> Self
pub const fn new(kind: AnnouncementKind) -> Self
An announcement of kind with every other option at its default.
Sourcepub const fn floods(&self) -> bool
pub const fn floods(&self) -> bool
Whether this announcement floods beyond the device’s neighbors.
Sourcepub fn parse(payload: &[u8]) -> Result<Self, AnnounceError>
pub fn parse(payload: &[u8]) -> Result<Self, AnnounceError>
Decode a CMD_ANNOUNCE payload.
Sourcepub fn write(&self, writer: &mut FrameWriter<'_>) -> Result<(), WriteError>
pub fn write(&self, writer: &mut FrameWriter<'_>) -> Result<(), WriteError>
Append this request’s options to a frame, omitting those left at their defaults.
Trait Implementations§
Source§impl Clone for Announcement
impl Clone for Announcement
Source§fn clone(&self) -> Announcement
fn clone(&self) -> Announcement
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Announcement
impl Debug for Announcement
Source§impl Default for Announcement
impl Default for Announcement
Source§impl PartialEq for Announcement
impl PartialEq for Announcement
impl Copy for Announcement
impl Eq for Announcement
impl StructuralPartialEq for Announcement
Auto Trait Implementations§
impl Freeze for Announcement
impl RefUnwindSafe for Announcement
impl Send for Announcement
impl Sync for Announcement
impl Unpin for Announcement
impl UnwindSafe for Announcement
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
Mutably borrows from an owned value. Read more
§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)
🔬This is a nightly-only experimental API. (
clone_to_uninit)