pub struct RegistrationConfig { /* private fields */ }Expand description
Configuration for registration and heartbeat maintenance.
Implementations§
Source§impl RegistrationConfig
impl RegistrationConfig
Sourcepub fn new(
heartbeat_interval: Duration,
initial_retry_delay: Duration,
max_retry_delay: Duration,
max_consecutive_failures: NonZeroUsize,
) -> Self
pub fn new( heartbeat_interval: Duration, initial_retry_delay: Duration, max_retry_delay: Duration, max_consecutive_failures: NonZeroUsize, ) -> Self
Creates a new configuration.
Sourcepub const fn heartbeat_interval(self) -> Duration
pub const fn heartbeat_interval(self) -> Duration
Returns the heartbeat interval.
Sourcepub const fn initial_retry_delay(self) -> Duration
pub const fn initial_retry_delay(self) -> Duration
Returns the initial retry delay.
Sourcepub const fn max_retry_delay(self) -> Duration
pub const fn max_retry_delay(self) -> Duration
Returns the maximum retry delay.
Sourcepub const fn max_consecutive_failures(self) -> NonZeroUsize
pub const fn max_consecutive_failures(self) -> NonZeroUsize
Returns the limit on consecutive heartbeat failures before re-registration.
Sourcepub fn validate(self) -> RegistryResult<()>
pub fn validate(self) -> RegistryResult<()>
Validates the configuration.
§Errors
Returns RegistryError::InvalidConfig when any duration is zero or the
retry delay bounds are inconsistent.
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§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
impl Copy for RegistrationConfig
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§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)