pub struct MoveHook { /* private fields */ }Expand description
文件移动钩子
在下载完成后将文件移动到指定目录。支持自动创建目标目录结构。
Implementations§
Trait Implementations§
Source§impl PostDownloadHook for MoveHook
impl PostDownloadHook for MoveHook
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,
执行文件移动操作
验证源文件存在后,将其移动到目标目录。
如果 create_dirs 为 true,会自动创建所需的目录层级。
Auto Trait Implementations§
impl Freeze for MoveHook
impl RefUnwindSafe for MoveHook
impl Send for MoveHook
impl Sync for MoveHook
impl Unpin for MoveHook
impl UnsafeUnpin for MoveHook
impl UnwindSafe for MoveHook
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