Struct obnam::chunk::GenerationChunk
source · [−]pub struct GenerationChunk { /* private fields */ }
Expand description
A chunk representing a backup generation.
A generation chunk lists all the data chunks for the SQLite file with the backup’s metadata. It’s different from a normal data chunk so that we can do things that make no sense to a data chunk. Generation chunks can be converted into or created from data chunks, for uploading to or downloading from the server.
Implementations
sourceimpl GenerationChunk
impl GenerationChunk
sourcepub fn new(chunk_ids: Vec<ChunkId>) -> Self
pub fn new(chunk_ids: Vec<ChunkId>) -> Self
Create a new backup generation chunk from metadata chunk ids.
sourcepub fn from_data_chunk(chunk: &DataChunk) -> Result<Self, GenerationChunkError>
pub fn from_data_chunk(chunk: &DataChunk) -> Result<Self, GenerationChunkError>
Create a new backup generation chunk from a data chunk.
sourcepub fn chunk_ids(&self) -> impl Iterator<Item = &ChunkId>
pub fn chunk_ids(&self) -> impl Iterator<Item = &ChunkId>
Return iterator over the metadata chunk identifiers.
sourcepub fn to_data_chunk(&self) -> Result<DataChunk, GenerationChunkError>
pub fn to_data_chunk(&self) -> Result<DataChunk, GenerationChunkError>
Convert generation chunk to a data chunk.
Trait Implementations
sourceimpl Debug for GenerationChunk
impl Debug for GenerationChunk
sourceimpl Default for GenerationChunk
impl Default for GenerationChunk
sourcefn default() -> GenerationChunk
fn default() -> GenerationChunk
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for GenerationChunk
impl<'de> Deserialize<'de> for GenerationChunk
sourcefn 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
sourceimpl Serialize for GenerationChunk
impl Serialize for GenerationChunk
Auto Trait Implementations
impl RefUnwindSafe for GenerationChunk
impl Send for GenerationChunk
impl Sync for GenerationChunk
impl Unpin for GenerationChunk
impl UnwindSafe for GenerationChunk
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more