pub struct HostTable {
pub hosts: Vec<Host>,
}Expand description
Represents a host table, consisting of addresses mapped to names.
Fields§
§hosts: Vec<Host>Contained hosts
Implementations§
Source§impl HostTable
impl HostTable
Sourcepub fn find_address(&self, name: &str) -> Option<IpAddr>
pub fn find_address(&self, name: &str) -> Option<IpAddr>
Returns the address for the first host matching the given name.
If no match is found, None is returned.
Sourcepub fn find_name(&self, addr: IpAddr) -> Option<&str>
pub fn find_name(&self, addr: IpAddr) -> Option<&str>
Returns the canonical name for the first host matching the given address.
If no match is found, None is returned.
Sourcepub fn find_host_by_address(&self, addr: IpAddr) -> Option<&Host>
pub fn find_host_by_address(&self, addr: IpAddr) -> Option<&Host>
Returns the first host matching the given address.
If no match is found, None is returned.
Sourcepub fn find_host_by_name(&self, name: &str) -> Option<&Host>
pub fn find_host_by_name(&self, name: &str) -> Option<&Host>
Returns the first host matching the given address.
If no match is found, None is returned.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HostTable
impl RefUnwindSafe for HostTable
impl Send for HostTable
impl Sync for HostTable
impl Unpin for HostTable
impl UnwindSafe for HostTable
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