pub struct UdpServiceDb { /* private fields */ }Expand description
Represents the UDP service database
Implementations§
Source§impl UdpServiceDb
impl UdpServiceDb
pub fn from_entries(entries: Vec<UdpServiceEntry>) -> Self
Sourcepub fn from_slice(slice: &[u8]) -> Result<Self>
pub fn from_slice(slice: &[u8]) -> Result<Self>
Create a new UDP service database from a binary slice
Sourcepub fn get(&self, port: u16) -> Option<&UdpServiceEntry>
pub fn get(&self, port: u16) -> Option<&UdpServiceEntry>
Lookup a UDP service entry by port
Sourcepub fn all(&self) -> impl Iterator<Item = (&u16, &UdpServiceEntry)>
pub fn all(&self) -> impl Iterator<Item = (&u16, &UdpServiceEntry)>
Get all UDP service entries as an iterator
Sourcepub fn wellknown(&self) -> impl Iterator<Item = (&u16, &UdpServiceEntry)>
pub fn wellknown(&self) -> impl Iterator<Item = (&u16, &UdpServiceEntry)>
Get well-known UDP service entries
Sourcepub fn common(&self) -> impl Iterator<Item = (&u16, &UdpServiceEntry)>
pub fn common(&self) -> impl Iterator<Item = (&u16, &UdpServiceEntry)>
Get common UDP service entries
Sourcepub fn entries(&self) -> Vec<UdpServiceEntry>
pub fn entries(&self) -> Vec<UdpServiceEntry>
Get all UDP service entries as a vector
Auto Trait Implementations§
impl Freeze for UdpServiceDb
impl RefUnwindSafe for UdpServiceDb
impl Send for UdpServiceDb
impl Sync for UdpServiceDb
impl Unpin for UdpServiceDb
impl UnwindSafe for UdpServiceDb
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