pub struct FileTimes { /* private fields */ }Expand description
Timestamps for a file.
This is a specialized version of std::fs::FileTimes for usage with
File::set_times. Unlike the standard library version,
this type records the timestamps itself, so a future io-uring file
implementation can consume them without converting through the standard
library type.
§Examples
use tokio::fs::FileTimes;
let times = FileTimes::new()
.set_accessed(std::time::SystemTime::now())
.set_modified(std::time::SystemTime::now());Implementations§
Source§impl FileTimes
impl FileTimes
Sourcepub fn set_accessed(self, t: SystemTime) -> Self
pub fn set_accessed(self, t: SystemTime) -> Self
Sets the last access time.
Sourcepub fn set_modified(self, t: SystemTime) -> Self
pub fn set_modified(self, t: SystemTime) -> Self
Sets the last modification time.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FileTimes
impl RefUnwindSafe for FileTimes
impl Send for FileTimes
impl Sync for FileTimes
impl Unpin for FileTimes
impl UnsafeUnpin for FileTimes
impl UnwindSafe for FileTimes
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