pub struct NtsProcesses(/* private fields */);Expand description
A bounded integer value with range checking at construction time.
See the module-level documentation for the valid range for each type.
Implementations§
Source§impl NtsProcesses
impl NtsProcesses
Sourcepub fn new(value: u16) -> Result<Self, ValueError>
pub fn new(value: u16) -> Result<Self, ValueError>
Creates a new value, returning an error if out of range.
§Examples
use chrony_confile::values::PollInterval;
let val = PollInterval::new(6)?;
assert_eq!(val.get(), 6);
let err = PollInterval::new(100);
assert!(err.is_err());Sourcepub const fn new_unchecked(value: u16) -> Self
pub const fn new_unchecked(value: u16) -> Self
Creates a new value without bounds checking.
This is safe because an out-of-range value is not undefined behavior;
the caller is responsible for ensuring the value is within MIN..=MAX.
Trait Implementations§
Source§impl Clone for NtsProcesses
impl Clone for NtsProcesses
Source§fn clone(&self) -> NtsProcesses
fn clone(&self) -> NtsProcesses
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 NtsProcesses
impl Debug for NtsProcesses
Source§impl Display for NtsProcesses
impl Display for NtsProcesses
Source§impl From<NtsProcesses> for u16
impl From<NtsProcesses> for u16
Source§fn from(v: NtsProcesses) -> Self
fn from(v: NtsProcesses) -> Self
Converts to this type from the input type.
Source§impl Hash for NtsProcesses
impl Hash for NtsProcesses
Source§impl Ord for NtsProcesses
impl Ord for NtsProcesses
Source§fn cmp(&self, other: &NtsProcesses) -> Ordering
fn cmp(&self, other: &NtsProcesses) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for NtsProcesses
impl PartialEq for NtsProcesses
Source§fn eq(&self, other: &NtsProcesses) -> bool
fn eq(&self, other: &NtsProcesses) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for NtsProcesses
impl PartialOrd for NtsProcesses
Source§impl TryFrom<i32> for NtsProcesses
impl TryFrom<i32> for NtsProcesses
impl Copy for NtsProcesses
impl Eq for NtsProcesses
impl StructuralPartialEq for NtsProcesses
Auto Trait Implementations§
impl Freeze for NtsProcesses
impl RefUnwindSafe for NtsProcesses
impl Send for NtsProcesses
impl Sync for NtsProcesses
impl Unpin for NtsProcesses
impl UnsafeUnpin for NtsProcesses
impl UnwindSafe for NtsProcesses
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