[][src]Struct asuran::manifest::target::BackupObject

pub struct BackupObject<T: Read> {
    ranges: Vec<ByteRange<T>>,
    total_size: u64,

A collection of Reads and the byte ranges that they are associated with, in an object to be committed to a repository.

The ranges list may contain zero, one, or many ranges, in the case of an empty file, a dense file, or a sparse file respectively.


ranges: Vec<ByteRange<T>>

The ranges of bytes that compose this object

total_size: u64

Total size of the object in bytes, including any holes


impl<T: Read> BackupObject<T>[src]

pub fn new(total_size: u64) -> BackupObject<T>[src]

Create a new, empty BackupObject with a predefined total size

pub fn add_range(&mut self, range: ByteRange<T>)[src]

Add a new range to the list

TODO (#13): Store the ranges in sorted order

pub fn total_size(&self) -> u64[src]

Returns the total_size of the object

pub fn set_total_size(&mut self, total_size: u64)[src]

Sets the total size of the object

pub fn ranges(self) -> Vec<ByteRange<T>>[src]

Returns the ranges in the object, consuming this struct

pub fn direct_add_range(&mut self, start: u64, end: u64, read: T)[src]

Adds a range without the caller needing to construct the objec themself

Auto Trait Implementations

impl<T> RefUnwindSafe for BackupObject<T> where
    T: RefUnwindSafe

impl<T> Send for BackupObject<T> where
    T: Send

impl<T> Sync for BackupObject<T> where
    T: Sync

impl<T> Unpin for BackupObject<T> where
    T: Unpin

impl<T> UnwindSafe for BackupObject<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]