pub struct HookContext {
pub gid: GroupId,
pub file_path: PathBuf,
pub status: DownloadStatus,
pub stats: DownloadStats,
pub error: Option<String>,
}Expand description
钩子执行的上下文信息,包含下载任务的状态和数据统计
Fields§
§gid: GroupId下载任务的唯一标识符
file_path: PathBuf下载文件的完整路径
status: DownloadStatus当前下载状态
stats: DownloadStats下载统计数据
error: Option<String>错误信息(如果有)
Implementations§
Source§impl HookContext
impl HookContext
Sourcepub fn new(
gid: GroupId,
file_path: PathBuf,
status: DownloadStatus,
stats: DownloadStats,
error: Option<String>,
) -> Self
pub fn new( gid: GroupId, file_path: PathBuf, status: DownloadStatus, stats: DownloadStats, error: Option<String>, ) -> Self
创建一个新的钩子上下文
§Arguments
gid- 下载任务组 IDfile_path- 下载文件路径status- 下载状态stats- 下载统计信息error- 可选的错误信息
Trait Implementations§
Source§impl Clone for HookContext
impl Clone for HookContext
Source§fn clone(&self) -> HookContext
fn clone(&self) -> HookContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for HookContext
impl RefUnwindSafe for HookContext
impl Send for HookContext
impl Sync for HookContext
impl Unpin for HookContext
impl UnsafeUnpin for HookContext
impl UnwindSafe for HookContext
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