Struct openssh_sftp_protocol::file_attrs::UnixTimeStamp
source · [−]pub struct UnixTimeStamp(_);
Expand description
Default value is 1970-01-01 00:00:00 UTC.
UnixTimeStamp stores number of seconds elapsed since 1970-01-01 00:00:00 UTC
as u32
.
Implementations
sourceimpl UnixTimeStamp
impl UnixTimeStamp
pub fn new(system_time: SystemTime) -> Result<Self, UnixTimeStampError>
sourcepub const fn unix_epoch() -> Self
pub const fn unix_epoch() -> Self
Return unix epoch, same as UnixTimeStamp::default
sourcepub fn from_raw(elapsed: u32) -> Option<Self>
pub fn from_raw(elapsed: u32) -> Option<Self>
Return None
if std::time::SystemTime
cannot hold the timestamp.
pub fn into_raw(self) -> u32
pub fn as_duration(self) -> Duration
pub fn as_system_time(self) -> SystemTime
Trait Implementations
sourceimpl Clone for UnixTimeStamp
impl Clone for UnixTimeStamp
sourcefn clone(&self) -> UnixTimeStamp
fn clone(&self) -> UnixTimeStamp
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for UnixTimeStamp
impl Debug for UnixTimeStamp
sourceimpl Default for UnixTimeStamp
impl Default for UnixTimeStamp
sourcefn default() -> UnixTimeStamp
fn default() -> UnixTimeStamp
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for UnixTimeStamp
impl<'de> Deserialize<'de> for UnixTimeStamp
sourcefn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Hash for UnixTimeStamp
impl Hash for UnixTimeStamp
sourceimpl PartialEq<UnixTimeStamp> for UnixTimeStamp
impl PartialEq<UnixTimeStamp> for UnixTimeStamp
sourcefn eq(&self, other: &UnixTimeStamp) -> bool
fn eq(&self, other: &UnixTimeStamp) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &UnixTimeStamp) -> bool
fn ne(&self, other: &UnixTimeStamp) -> bool
This method tests for !=
.
impl Copy for UnixTimeStamp
impl Eq for UnixTimeStamp
impl StructuralEq for UnixTimeStamp
impl StructuralPartialEq for UnixTimeStamp
Auto Trait Implementations
impl RefUnwindSafe for UnixTimeStamp
impl Send for UnixTimeStamp
impl Sync for UnixTimeStamp
impl Unpin for UnixTimeStamp
impl UnwindSafe for UnixTimeStamp
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more