pub struct RegistrationConfig {
pub ttl: Duration,
pub auto_refresh: bool,
pub refresh_interval: Duration,
pub interfaces: Vec<String>,
pub protocols: HashSet<ProtocolType>,
pub enable_ipv6: bool,
pub enable_ipv4: bool,
pub priority: u16,
pub weight: u16,
}Expand description
Configuration for service registration
Fields§
§ttl: DurationTime-to-live for the service record
auto_refresh: boolWhether to auto-refresh the service registration
refresh_interval: DurationRefresh interval (only used if auto_refresh is true)
interfaces: Vec<String>Network interfaces to register on
protocols: HashSet<ProtocolType>Protocols to use for registration
enable_ipv6: boolWhether to enable IPv6 registration
enable_ipv4: boolWhether to enable IPv4 registration
priority: u16Priority for the service (used in some protocols)
weight: u16Weight for the service (used in some protocols)
Implementations§
Source§impl RegistrationConfig
impl RegistrationConfig
Sourcepub fn auto_refresh(self, auto_refresh: bool) -> Self
pub fn auto_refresh(self, auto_refresh: bool) -> Self
Enable or disable auto-refresh
Sourcepub fn refresh_interval(self, interval: Duration) -> Self
pub fn refresh_interval(self, interval: Duration) -> Self
Set the refresh interval
Sourcepub fn interfaces<I, S>(self, interfaces: I) -> Self
pub fn interfaces<I, S>(self, interfaces: I) -> Self
Set network interfaces for registration
Sourcepub fn protocols<I>(self, protocols: I) -> Selfwhere
I: IntoIterator<Item = ProtocolType>,
pub fn protocols<I>(self, protocols: I) -> Selfwhere
I: IntoIterator<Item = ProtocolType>,
Set registration protocols
Trait Implementations§
Source§impl Clone for RegistrationConfig
impl Clone for RegistrationConfig
Source§fn clone(&self) -> RegistrationConfig
fn clone(&self) -> RegistrationConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RegistrationConfig
impl Debug for RegistrationConfig
Source§impl Default for RegistrationConfig
impl Default for RegistrationConfig
Source§impl<'de> Deserialize<'de> for RegistrationConfig
impl<'de> Deserialize<'de> for RegistrationConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RegistrationConfig
impl RefUnwindSafe for RegistrationConfig
impl Send for RegistrationConfig
impl Sync for RegistrationConfig
impl Unpin for RegistrationConfig
impl UnwindSafe for RegistrationConfig
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