[][src]Struct insta::Snapshot

pub struct Snapshot { /* fields omitted */ }

A helper to work with stored snapshots.

Implementations

impl Snapshot[src]

pub fn from_file<P: AsRef<Path>>(p: P) -> Result<Snapshot, Box<dyn Error>>[src]

Loads a snapshot from a file.

pub fn module_name(&self) -> &str[src]

Returns the module name.

pub fn snapshot_name(&self) -> Option<&str>[src]

Returns the snapshot name.

pub fn metadata(&self) -> &MetaData[src]

The metadata in the snapshot.

pub fn contents(&self) -> &SnapshotContents[src]

The snapshot contents

pub fn contents_str(&self) -> &str[src]

The snapshot contents as a &str

Trait Implementations

impl Clone for Snapshot[src]

impl Debug for Snapshot[src]

impl<'de> Deserialize<'de> for Snapshot[src]

impl Serialize for Snapshot[src]

Auto Trait Implementations

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.