Struct sota::rvi::transfers::Transfer [] [src]

pub struct Transfer {
    pub update_id: UpdateRequestId,
    pub checksum: String,
    pub transferred_chunks: Vec<u64>,
    pub storage_dir: String,
    pub last_chunk_received: i64,
}

Holds the details of the transferred chunks relating to an UpdateRequestId.

Fields

update_id
checksum
transferred_chunks
storage_dir
last_chunk_received

Methods

impl Transfer
[src]

fn new(storage_dir: String, update_id: UpdateRequestId, checksum: String) -> Transfer

Prepare for the transfer of a new package.

fn write_chunk(&mut self, data: &str, index: u64) -> Result<(), String>

Write the received chunk to disk and store metadata inside Transfer.

fn assemble_package(&self) -> Result<PathBuf, String>

Assemble all received chunks into a complete package.

Trait Implementations

impl Drop for Transfer
[src]

fn drop(&mut self)

A method called when the value goes out of scope. Read more