pub struct TouchHook;Expand description
文件时间戳更新钩子
在下载完成后更新文件的修改时间和访问时间为当前系统时间。
Implementations§
Trait Implementations§
Source§impl PostDownloadHook for TouchHook
impl PostDownloadHook for TouchHook
Source§fn on_complete<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 HookContext,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_complete<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 HookContext,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
更新文件的修改时间和访问时间
将文件的 mtime 和 atime 都设置为当前系统时间。
Source§fn on_error<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_context: &'life1 HookContext,
_error: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn on_error<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_context: &'life1 HookContext,
_error: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
TouchHook 在错误时不执行
Auto Trait Implementations§
impl Freeze for TouchHook
impl RefUnwindSafe for TouchHook
impl Send for TouchHook
impl Sync for TouchHook
impl Unpin for TouchHook
impl UnsafeUnpin for TouchHook
impl UnwindSafe for TouchHook
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