pub struct EntryView<'a>(/* private fields */);Expand description
Zero-copy view into a 16-byte SD entry in a buffer.
Wire layout (16 bytes total):
[0]: entry type[1]:index_first_options_run[2]:index_second_options_run[3]:options_count(packed nibbles)[4..6]:service_id(BE)[6..8]:instance_id(BE)[8]:major_version[9..12]: ttl (24-bit BE)[12..16]:minor_version(BE) for service entries, OR[12..14]counter +[14..16]event_group_idfor eventgroup entries
Implementations§
Source§impl EntryView<'_>
impl EntryView<'_>
Sourcepub fn entry_type(&self) -> Result<EntryType, Error>
pub fn entry_type(&self) -> Result<EntryType, Error>
Sourcepub fn index_first_options_run(&self) -> u8
pub fn index_first_options_run(&self) -> u8
Returns the index of the first options run.
Sourcepub fn index_second_options_run(&self) -> u8
pub fn index_second_options_run(&self) -> u8
Returns the index of the second options run.
Sourcepub fn options_count(&self) -> OptionsCount
pub fn options_count(&self) -> OptionsCount
Returns the packed options count.
Sourcepub fn service_id(&self) -> u16
pub fn service_id(&self) -> u16
Returns the service ID.
Sourcepub fn instance_id(&self) -> u16
pub fn instance_id(&self) -> u16
Returns the instance ID.
Sourcepub fn major_version(&self) -> u8
pub fn major_version(&self) -> u8
Returns the major version.
Sourcepub fn minor_version(&self) -> u32
pub fn minor_version(&self) -> u32
Minor version (only valid for service entries).
Sourcepub fn counter(&self) -> u16
pub fn counter(&self) -> u16
Counter field (only valid for eventgroup entries). Masked to lower 4 bits.
Sourcepub fn event_group_id(&self) -> u16
pub fn event_group_id(&self) -> u16
Event group ID (only valid for eventgroup entries).
Trait Implementations§
impl<'a> Copy for EntryView<'a>
Auto Trait Implementations§
impl<'a> Freeze for EntryView<'a>
impl<'a> RefUnwindSafe for EntryView<'a>
impl<'a> Send for EntryView<'a>
impl<'a> Sync for EntryView<'a>
impl<'a> Unpin for EntryView<'a>
impl<'a> UnsafeUnpin for EntryView<'a>
impl<'a> UnwindSafe for EntryView<'a>
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