Skip to main content

ServerConfig

Struct ServerConfig 

Source
pub struct ServerConfig {
Show 31 fields pub hostname: String, pub port: UdpPort, pub minpoll: PollInterval, pub maxpoll: PollInterval, pub connectivity: SourceConnectivity, pub auto_offline: bool, pub presend: PollInterval, pub burst: bool, pub iburst: bool, pub min_stratum: Stratum, pub poll_target: PollTarget, pub version: Option<NtpVersion>, pub min_samples: Option<u32>, pub max_samples: Option<u32>, pub filter: Option<u32>, pub interleaved: bool, pub select_opts: SelectOptions, pub nts: bool, pub nts_port: UdpPort, pub copy: bool, pub ext_fields: u32, pub authkey: u32, pub cert_set: u32, pub max_delay: f64, pub max_delay_ratio: f64, pub max_delay_dev_ratio: f64, pub max_delay_quant: f64, pub min_delay: f64, pub asymmetry: f64, pub offset: f64, pub family: AddressFamily,
}
Expand description

Configuration for an NTP server source (or peer).

This is the largest configuration struct in the crate, with ~30 fields covering all chrony options for the server and peer directives: polling intervals, selection options, authentication, NTS, delay constraints, and address family preferences.

Default values mirror chrony’s built-in defaults.

§Examples

use chrony_confile::ast::ServerConfig;

let config = ServerConfig {
    hostname: "ntp.example.com".to_string(),
    iburst: true,
    ..Default::default()
};

assert!(config.iburst);
assert_eq!(config.minpoll.get(), 6);

Fields§

§hostname: String§port: UdpPort§minpoll: PollInterval§maxpoll: PollInterval§connectivity: SourceConnectivity§auto_offline: bool§presend: PollInterval§burst: bool§iburst: bool§min_stratum: Stratum§poll_target: PollTarget§version: Option<NtpVersion>§min_samples: Option<u32>§max_samples: Option<u32>§filter: Option<u32>§interleaved: bool§select_opts: SelectOptions§nts: bool§nts_port: UdpPort§copy: bool§ext_fields: u32§authkey: u32§cert_set: u32§max_delay: f64§max_delay_ratio: f64§max_delay_dev_ratio: f64§max_delay_quant: f64§min_delay: f64§asymmetry: f64§offset: f64§family: AddressFamily

Implementations§

Source§

impl ServerConfig

Source

pub fn prefer(&self) -> bool

Returns true if the prefer option is set.

Source

pub fn noselect(&self) -> bool

Returns true if the noselect option is set.

Source

pub fn trust(&self) -> bool

Returns true if the trust option is set.

Source

pub fn require(&self) -> bool

Returns true if the require option is set.

Source

pub fn xleave(&self) -> bool

Returns true if interleaved mode (xleave) is enabled.

Trait Implementations§

Source§

impl Clone for ServerConfig

Source§

fn clone(&self) -> ServerConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ServerConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ServerConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for ServerConfig

Source§

fn eq(&self, other: &ServerConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ServerConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.