pub struct TransferPlan {
pub file: FileMeta,
pub chunk_size: u64,
pub chunks: Vec<ChunkMeta>,
}Expand description
The full transfer plan for one file: chunk layout derived from size.
Fields§
§file: FileMetaThe file being transferred.
chunk_size: u64Chunk size used to slice the file.
chunks: Vec<ChunkMeta>All chunks, in order.
Implementations§
Source§impl TransferPlan
impl TransferPlan
Sourcepub fn new(file: FileMeta) -> Self
pub fn new(file: FileMeta) -> Self
Build a plan for file using the protocol default
CHUNK_SIZE.
Sourcepub fn with_chunk_size(file: FileMeta, chunk_size: u64) -> Self
pub fn with_chunk_size(file: FileMeta, chunk_size: u64) -> Self
Build a plan for file with an explicit chunk size.
The last chunk may be shorter than chunk_size.
Sourcepub fn total_bytes(&self) -> u64
pub fn total_bytes(&self) -> u64
The total number of bytes covered by the plan.
Trait Implementations§
Source§impl Clone for TransferPlan
impl Clone for TransferPlan
Source§fn clone(&self) -> TransferPlan
fn clone(&self) -> TransferPlan
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 moreSource§impl Debug for TransferPlan
impl Debug for TransferPlan
Source§impl<'de> Deserialize<'de> for TransferPlan
impl<'de> Deserialize<'de> for TransferPlan
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
impl Eq for TransferPlan
Source§impl PartialEq for TransferPlan
impl PartialEq for TransferPlan
Source§impl Serialize for TransferPlan
impl Serialize for TransferPlan
impl StructuralPartialEq for TransferPlan
Auto Trait Implementations§
impl Freeze for TransferPlan
impl RefUnwindSafe for TransferPlan
impl Send for TransferPlan
impl Sync for TransferPlan
impl Unpin for TransferPlan
impl UnsafeUnpin for TransferPlan
impl UnwindSafe for TransferPlan
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