pub struct LocalSubnets { /* private fields */ }Available on crate feature
connect-server only.Expand description
The subnets this host is on.
Enumerated once, at construction: interfaces do change, but re-reading them on every
request turns a GET into a syscall storm, and a device whose address changes is going
to be restarted or re-paired anyway.
Implementations§
Source§impl LocalSubnets
impl LocalSubnets
Sourcepub fn detect() -> Result<Self>
pub fn detect() -> Result<Self>
Read this host’s interfaces.
§Errors
When the interfaces cannot be enumerated at all. A host in that state cannot make the check the specification requires, and the caller must decide whether to serve the LAN-only routes without it — this crate will not decide that quietly.
Sourcepub fn from_prefixes(nets: impl IntoIterator<Item = (IpAddr, u8)>) -> Self
pub fn from_prefixes(nets: impl IntoIterator<Item = (IpAddr, u8)>) -> Self
A fixed set of subnets, for a host that knows its own topology better than we do.
Trait Implementations§
Source§impl Clone for LocalSubnets
impl Clone for LocalSubnets
Auto Trait Implementations§
impl Forget for LocalSubnets
impl Freeze for LocalSubnets
impl RefUnwindSafe for LocalSubnets
impl Send for LocalSubnets
impl Sync for LocalSubnets
impl Unpin for LocalSubnets
impl UnsafeUnpin for LocalSubnets
impl UnwindSafe for LocalSubnets
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