pub enum Interface {
Unspecified,
Interface(u32),
}
Expand description
Enum to hold the Interface a service should be advertised on.
Variants§
Unspecified
Advertise on all interfaces
Interface(u32)
Advertise on specified interface, e.g. as obtained by if_nametoindex(3)
Implementations§
Source§impl Interface
impl Interface
Sourcepub fn from_ifname(name: &str) -> Result<Interface, ZeroconfError>
pub fn from_ifname(name: &str) -> Result<Interface, ZeroconfError>
Create an Interface
instance from an interface name.
§Examples
let interface = async_zeroconf::Interface::from_ifname("lo0")?;
println!("{:?}", interface);
let service_ref = async_zeroconf::Service::new("Server", "_http._tcp", 80)
.set_interface(interface)
.publish().await?;
Trait Implementations§
impl Copy for Interface
impl Eq for Interface
impl StructuralPartialEq for Interface
Auto Trait Implementations§
impl Freeze for Interface
impl RefUnwindSafe for Interface
impl Send for Interface
impl Sync for Interface
impl Unpin for Interface
impl UnwindSafe for Interface
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