pub struct Snapshot { /* private fields */ }
Expand description
A helper to work with stored snapshots.
Implementations
sourceimpl Snapshot
impl Snapshot
sourcepub fn from_file<P: AsRef<Path>>(p: P) -> Result<Snapshot, Box<dyn Error>>
pub fn from_file<P: AsRef<Path>>(p: P) -> Result<Snapshot, Box<dyn Error>>
Loads a snapshot from a file.
sourcepub fn module_name(&self) -> &str
pub fn module_name(&self) -> &str
Returns the module name.
sourcepub fn snapshot_name(&self) -> Option<&str>
pub fn snapshot_name(&self) -> Option<&str>
Returns the snapshot name.
sourcepub fn contents(&self) -> &SnapshotContents
pub fn contents(&self) -> &SnapshotContents
The snapshot contents
sourcepub fn contents_str(&self) -> &str
pub fn contents_str(&self) -> &str
The snapshot contents as a &str
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Snapshot
impl<'de> Deserialize<'de> for Snapshot
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
Auto Trait Implementations
impl RefUnwindSafe for Snapshot
impl Send for Snapshot
impl Sync for Snapshot
impl Unpin for Snapshot
impl UnwindSafe for Snapshot
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