Struct icu::calendar::types::NanoSecond
source · pub struct NanoSecond(/* private fields */);
Expand description
A fractional second component, stored as nanoseconds.
Must be within inclusive bounds [0, 999_999_999]
.
Implementations§
source§impl NanoSecond
impl NanoSecond
source§impl NanoSecond
impl NanoSecond
sourcepub fn try_add(self, other: u32) -> Option<NanoSecond>
pub fn try_add(self, other: u32) -> Option<NanoSecond>
Attempts to add two values.
Returns Some
if the sum is within bounds.
Returns None
if the sum is out of bounds.
sourcepub fn try_sub(self, other: u32) -> Option<NanoSecond>
pub fn try_sub(self, other: u32) -> Option<NanoSecond>
Attempts to subtract two values.
Returns Some
if the difference is within bounds.
Returns None
if the difference is out of bounds.
Trait Implementations§
source§impl Clone for NanoSecond
impl Clone for NanoSecond
source§fn clone(&self) -> NanoSecond
fn clone(&self) -> NanoSecond
Returns a copy 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 NanoSecond
impl Debug for NanoSecond
source§impl Default for NanoSecond
impl Default for NanoSecond
source§fn default() -> NanoSecond
fn default() -> NanoSecond
Returns the “default value” for a type. Read more
source§impl<C, A, Z> GetField<NanoSecond> for CustomZonedDateTime<A, Z>where
C: Calendar,
A: AsCalendar<Calendar = C>,
impl<C, A, Z> GetField<NanoSecond> for CustomZonedDateTime<A, Z>where
C: Calendar,
A: AsCalendar<Calendar = C>,
source§fn get_field(&self) -> NanoSecond
fn get_field(&self) -> NanoSecond
Returns the value of this trait’s field
T
.source§impl<C, A> GetField<NanoSecond> for DateTime<A>where
C: Calendar,
A: AsCalendar<Calendar = C>,
impl<C, A> GetField<NanoSecond> for DateTime<A>where
C: Calendar,
A: AsCalendar<Calendar = C>,
source§fn get_field(&self) -> NanoSecond
fn get_field(&self) -> NanoSecond
Returns the value of this trait’s field
T
.source§impl GetField<NanoSecond> for Time
impl GetField<NanoSecond> for Time
source§fn get_field(&self) -> NanoSecond
fn get_field(&self) -> NanoSecond
Returns the value of this trait’s field
T
.source§impl Hash for NanoSecond
impl Hash for NanoSecond
source§impl IntoOption<NanoSecond> for NanoSecond
impl IntoOption<NanoSecond> for NanoSecond
source§fn into_option(self) -> Option<NanoSecond>
fn into_option(self) -> Option<NanoSecond>
Return
self
as an Option<T>
source§impl Ord for NanoSecond
impl Ord for NanoSecond
source§fn cmp(&self, other: &NanoSecond) -> Ordering
fn cmp(&self, other: &NanoSecond) -> Ordering
1.21.0 · 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 NanoSecond
impl PartialEq for NanoSecond
source§impl PartialOrd for NanoSecond
impl PartialOrd for NanoSecond
source§impl TryFrom<u32> for NanoSecond
impl TryFrom<u32> for NanoSecond
source§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.
source§fn try_from(
input: u32,
) -> Result<NanoSecond, <NanoSecond as TryFrom<u32>>::Error>
fn try_from( input: u32, ) -> Result<NanoSecond, <NanoSecond as TryFrom<u32>>::Error>
Performs the conversion.
source§impl TryFrom<usize> for NanoSecond
impl TryFrom<usize> for NanoSecond
source§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.
source§fn try_from(
input: usize,
) -> Result<NanoSecond, <NanoSecond as TryFrom<usize>>::Error>
fn try_from( input: usize, ) -> Result<NanoSecond, <NanoSecond as TryFrom<usize>>::Error>
Performs the conversion.
impl Copy for NanoSecond
impl Eq for NanoSecond
impl StructuralPartialEq for NanoSecond
Auto Trait Implementations§
impl Freeze for NanoSecond
impl RefUnwindSafe for NanoSecond
impl Send for NanoSecond
impl Sync for NanoSecond
impl Unpin for NanoSecond
impl UnwindSafe for NanoSecond
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more