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

pub struct RestoreObject<T: Write> {
    ranges: Vec<ByteRange<T>>,
    total_size: u64,
}

A collection of Writes and their associated byte ranges with in an object to be restored from 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

Fields

ranges: Vec<ByteRange<T>>

The list of writers and extents used to restore an object

total_size: u64

Total size of the resulting object, including any holes

Methods

impl<T: Write> RestoreObject<T>[src]

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

Create a new, empty RestoreObject with a defined 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, write: T)[src]

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

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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]