pub struct Time {
pub usec: i64,
}Expand description
Time type (microseconds since midnight)
Fields§
§usec: i64Microseconds since midnight
Implementations§
Source§impl Time
impl Time
Sourcepub fn new(hour: u8, minute: u8, second: u8, usec: u32) -> Self
pub fn new(hour: u8, minute: u8, second: u8, usec: u32) -> Self
Create from hours, minutes, seconds, microseconds.
Invalid components return midnight instead of panicking. Use
Time::try_new when invalid input must be reported to the caller.
§Arguments
hour— Hour component (0–23).minute— Minute component (0–59).second— Second component (0–59).usec— Microseconds within the current second.
Sourcepub fn try_new(
hour: u8,
minute: u8,
second: u8,
usec: u32,
) -> Result<Self, TypeError>
pub fn try_new( hour: u8, minute: u8, second: u8, usec: u32, ) -> Result<Self, TypeError>
Fallible constructor from hours, minutes, seconds, microseconds.
Sourcepub fn microsecond(&self) -> u32
pub fn microsecond(&self) -> u32
Get microseconds component (0-999999)
Trait Implementations§
impl Copy for Time
impl Eq for Time
impl StructuralPartialEq for Time
Auto Trait Implementations§
impl Freeze for Time
impl RefUnwindSafe for Time
impl Send for Time
impl Sync for Time
impl Unpin for Time
impl UnsafeUnpin for Time
impl UnwindSafe for Time
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