pub struct ClientLogSize(/* 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 ClientLogSize
impl ClientLogSize
Sourcepub fn new(value: u64) -> Result<Self, ValueError>
pub fn new(value: u64) -> 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: u64) -> Self
pub const fn new_unchecked(value: u64) -> 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 ClientLogSize
impl Clone for ClientLogSize
Source§fn clone(&self) -> ClientLogSize
fn clone(&self) -> ClientLogSize
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 ClientLogSize
impl Debug for ClientLogSize
Source§impl Display for ClientLogSize
impl Display for ClientLogSize
Source§impl From<ClientLogSize> for u64
impl From<ClientLogSize> for u64
Source§fn from(v: ClientLogSize) -> Self
fn from(v: ClientLogSize) -> Self
Converts to this type from the input type.
Source§impl Hash for ClientLogSize
impl Hash for ClientLogSize
Source§impl Ord for ClientLogSize
impl Ord for ClientLogSize
Source§fn cmp(&self, other: &ClientLogSize) -> Ordering
fn cmp(&self, other: &ClientLogSize) -> 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 ClientLogSize
impl PartialEq for ClientLogSize
Source§fn eq(&self, other: &ClientLogSize) -> bool
fn eq(&self, other: &ClientLogSize) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for ClientLogSize
impl PartialOrd for ClientLogSize
Source§impl TryFrom<i64> for ClientLogSize
impl TryFrom<i64> for ClientLogSize
impl Copy for ClientLogSize
impl Eq for ClientLogSize
impl StructuralPartialEq for ClientLogSize
Auto Trait Implementations§
impl Freeze for ClientLogSize
impl RefUnwindSafe for ClientLogSize
impl Send for ClientLogSize
impl Sync for ClientLogSize
impl Unpin for ClientLogSize
impl UnsafeUnpin for ClientLogSize
impl UnwindSafe for ClientLogSize
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