pub enum TransferEvent {
Started {
role: Role,
},
Progress {
role: Role,
processed: u64,
total: u64,
speed: f64,
},
Completed {
role: Role,
},
Failed {
role: Role,
message: String,
},
FileNames {
role: Role,
file_names: Vec<String>,
},
}Expand description
传输过程中对外发送的统一事件模型。
该枚举用于描述一次传输在某个角色(发送端 / 接收端)下的 生命周期状态变化。
⚠️ 注意:
- 这是通知型事件,不参与错误控制流
- 不用于
Result/anyhow - payload 直接体现在枚举字段中
Variants§
Implementations§
Source§impl TransferEvent
impl TransferEvent
Trait Implementations§
Source§impl Clone for TransferEvent
impl Clone for TransferEvent
Source§fn clone(&self) -> TransferEvent
fn clone(&self) -> TransferEvent
Returns a duplicate of the value. Read more
1.0.0 · 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 TransferEvent
impl RefUnwindSafe for TransferEvent
impl Send for TransferEvent
impl Sync for TransferEvent
impl Unpin for TransferEvent
impl UnsafeUnpin for TransferEvent
impl UnwindSafe for TransferEvent
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