pub struct ServerOptions { /* private fields */ }Expand description
Build-time configuration for an mDNS Endpoint.
The defaults bind on one interface for both IPv4 and IPv6: the first
up + multicast-capable, non-loopback interface reported by
getifs::interfaces that has a usable address for each enabled family,
falling back to the loopback interface if no other is eligible. Use
Self::with_interface_index to pin a specific interface.
Implementations§
Source§impl ServerOptions
impl ServerOptions
Sourcepub const fn interface_index(&self) -> Option<u32>
pub const fn interface_index(&self) -> Option<u32>
The pinned interface index, if any.
Sourcepub const fn max_payload_size(&self) -> usize
pub const fn max_payload_size(&self) -> usize
Maximum outgoing-packet buffer size. RFC 6762 §17 recommends staying within the path MTU on send (~1500 bytes for Ethernet).
Sourcepub const fn max_recv_packet_size(&self) -> usize
pub const fn max_recv_packet_size(&self) -> usize
Maximum size of an inbound mDNS datagram that we will fully receive without truncation. RFC 6762 §17 says implementations MUST be prepared to receive messages up to 9000 bytes.
Sourcepub const fn endpoint_config(&self) -> &EndpointConfig
pub const fn endpoint_config(&self) -> &EndpointConfig
The proto-layer EndpointConfig.
Sourcepub const fn with_ipv4(self, enable: bool) -> Self
pub const fn with_ipv4(self, enable: bool) -> Self
Enable or disable IPv4. At least one of v4/v6 must remain enabled.
Sourcepub const fn with_interface_index(self, idx: Option<u32>) -> Self
pub const fn with_interface_index(self, idx: Option<u32>) -> Self
Pin the listener to a specific interface (by OS index). When None
(the default), the first multicast-capable, non-loopback interface is
picked.
Sourcepub const fn with_max_payload_size(self, size: usize) -> Self
pub const fn with_max_payload_size(self, size: usize) -> Self
Override the maximum outgoing-packet buffer size.
Sourcepub const fn with_max_recv_packet_size(self, size: usize) -> Self
pub const fn with_max_recv_packet_size(self, size: usize) -> Self
Override the inbound receive buffer size.
Sourcepub fn with_endpoint_config(self, cfg: EndpointConfig) -> Self
pub fn with_endpoint_config(self, cfg: EndpointConfig) -> Self
Override the proto-layer EndpointConfig.
Trait Implementations§
Source§impl Clone for ServerOptions
impl Clone for ServerOptions
Source§fn clone(&self) -> ServerOptions
fn clone(&self) -> ServerOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ServerOptions
impl Debug for ServerOptions
Auto Trait Implementations§
impl Freeze for ServerOptions
impl RefUnwindSafe for ServerOptions
impl Send for ServerOptions
impl Sync for ServerOptions
impl Unpin for ServerOptions
impl UnsafeUnpin for ServerOptions
impl UnwindSafe for ServerOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more