pub struct TransferState {
pub id: String,
pub file_path: String,
pub total_bytes: u64,
pub bytes_transferred: u64,
pub chunks_completed: u32,
pub total_chunks: u32,
pub checksum_so_far: String,
pub started_at: i64,
pub last_updated: i64,
pub resume_capability: ResumeCapability,
pub is_upload: bool,
}Expand description
State of an in-progress or resumable transfer.
Fields§
§id: StringUnique transfer identifier.
file_path: StringPath of the file being transferred.
total_bytes: u64Total file size in bytes.
bytes_transferred: u64Bytes successfully transferred.
chunks_completed: u32Number of completed chunks.
total_chunks: u32Total number of chunks.
checksum_so_far: StringBLAKE3 checksum of bytes transferred so far (hex-encoded).
started_at: i64Unix timestamp (ms) when transfer started.
last_updated: i64Unix timestamp (ms) of last activity.
resume_capability: ResumeCapabilityResume capability for this transfer.
is_upload: boolWhether this is an upload (true) or download (false).
Implementations§
Source§impl TransferState
impl TransferState
Sourcepub fn percent_complete(&self) -> u32
pub fn percent_complete(&self) -> u32
Returns transfer progress as a percentage (0-100).
Sourcepub fn chunks_remaining(&self) -> u32
pub fn chunks_remaining(&self) -> u32
Returns the number of remaining chunks.
Sourcepub fn bytes_remaining(&self) -> u64
pub fn bytes_remaining(&self) -> u64
Returns bytes remaining to transfer.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Returns true if transfer is complete.
Trait Implementations§
Source§impl Clone for TransferState
impl Clone for TransferState
Source§fn clone(&self) -> TransferState
fn clone(&self) -> TransferState
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 moreSource§impl Debug for TransferState
impl Debug for TransferState
Source§impl<'de> Deserialize<'de> for TransferState
impl<'de> Deserialize<'de> for TransferState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TransferState
impl PartialEq for TransferState
Source§impl Serialize for TransferState
impl Serialize for TransferState
impl Eq for TransferState
impl StructuralPartialEq for TransferState
Auto Trait Implementations§
impl Freeze for TransferState
impl RefUnwindSafe for TransferState
impl Send for TransferState
impl Sync for TransferState
impl Unpin for TransferState
impl UnsafeUnpin for TransferState
impl UnwindSafe for TransferState
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