pub struct ServiceEntryRepr {
pub entry_type: EntryType,
pub index_first_option_run: u8,
pub index_second_option_run: u8,
pub number_of_options: NumberOfOptions,
pub service_id: u16,
pub instance_id: u16,
pub major_version: u8,
pub ttl: u32,
pub minor_version: u32,
}Expand description
High-level representation of a Service Entry.
This provides a builder-style API for constructing and parsing service entries without manually managing byte arrays.
Fields§
§entry_type: EntryTypeEntry type (FindService or OfferService)
index_first_option_run: u8Index of first option run
index_second_option_run: u8Index of second option run
number_of_options: NumberOfOptionsNumber of options in both runs
service_id: u16Service ID
instance_id: u16Instance ID
major_version: u8Major version
ttl: u32TTL in seconds (0xFFFFFF = infinite, 0 = stop offer)
minor_version: u32Minor version
Implementations§
Source§impl ServiceEntryRepr
impl ServiceEntryRepr
Sourcepub fn emit<T: AsRef<[u8]> + AsMut<[u8]>>(&self, entry: &mut ServiceEntry<T>)
pub fn emit<T: AsRef<[u8]> + AsMut<[u8]>>(&self, entry: &mut ServiceEntry<T>)
Emit this representation into a ServiceEntry buffer.
§Parameters
entry- Mutable ServiceEntry to write into
Sourcepub const fn buffer_len() -> usize
pub const fn buffer_len() -> usize
Get the wire format size of this entry (always 16 bytes).
Trait Implementations§
Source§impl Clone for ServiceEntryRepr
impl Clone for ServiceEntryRepr
Source§fn clone(&self) -> ServiceEntryRepr
fn clone(&self) -> ServiceEntryRepr
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ServiceEntryRepr
impl Debug for ServiceEntryRepr
Source§impl PartialEq for ServiceEntryRepr
impl PartialEq for ServiceEntryRepr
impl Copy for ServiceEntryRepr
impl Eq for ServiceEntryRepr
impl StructuralPartialEq for ServiceEntryRepr
Auto Trait Implementations§
impl Freeze for ServiceEntryRepr
impl RefUnwindSafe for ServiceEntryRepr
impl Send for ServiceEntryRepr
impl Sync for ServiceEntryRepr
impl Unpin for ServiceEntryRepr
impl UnwindSafe for ServiceEntryRepr
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