Struct snapshot::SnapshotReader
source · pub struct SnapshotReader {
pub(crate) dir: PathBuf,
pub(crate) key: Option<CryptKey>,
}
Expand description
Reads snapshots created by SnapshotWriter
.
Fields§
§dir: PathBuf
§key: Option<CryptKey>
If encryption is used, the plaintext key will be stored here.
Implementations§
source§impl SnapshotReader
impl SnapshotReader
sourcepub fn new(root: &Path, require_encrypted: bool) -> Result<Self>
pub fn new(root: &Path, require_encrypted: bool) -> Result<Self>
Reads a snapshot at root
. Set require_encrypted to require an encrypted snapshot.
sourcepub fn raw_fragment(&self, name: &str) -> Result<Box<dyn Read>>
pub fn raw_fragment(&self, name: &str) -> Result<Box<dyn Read>>
Gets access to a Read
impl that represents a fragment.
sourcepub fn read_fragment<T: DeserializeOwned>(&self, name: &str) -> Result<T>
pub fn read_fragment<T: DeserializeOwned>(&self, name: &str) -> Result<T>
Reads a fragment.
sourcepub fn list_fragments(&self) -> Result<Vec<String>>
pub fn list_fragments(&self) -> Result<Vec<String>>
Reads the names of all fragments in this namespace.
sourcepub fn list_namespaces(&self) -> Result<Vec<String>>
pub fn list_namespaces(&self) -> Result<Vec<String>>
Reads the names of all child namespaces
Trait Implementations§
source§impl Clone for SnapshotReader
impl Clone for SnapshotReader
source§fn clone(&self) -> SnapshotReader
fn clone(&self) -> SnapshotReader
Returns a copy of the value. Read more
1.0.0 · 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 SnapshotReader
impl Debug for SnapshotReader
source§impl<'de> Deserialize<'de> for SnapshotReader
impl<'de> Deserialize<'de> for SnapshotReader
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
Auto Trait Implementations§
impl Freeze for SnapshotReader
impl RefUnwindSafe for SnapshotReader
impl Send for SnapshotReader
impl Sync for SnapshotReader
impl Unpin for SnapshotReader
impl UnwindSafe for SnapshotReader
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)