[][src]Struct egress::Artifact

pub struct Artifact { /* fields omitted */ }

An Artifact is the main object that Egress uses to handle and compare data produced from your tests. It's basically just a map from string keys to Entrys.

Methods

impl Artifact[src]

pub fn new() -> Self[src]

Create an empty Artifact. This is useful for building tree-structured artifacts, but the root artifact for a given test should always come from Egress::artifact.

pub fn insert(&mut self, name: &str, entry: Entry)[src]

Insert an Entry into the artifact, with a given string name. The other insert_* methods are just convenient wrappers around this one.

pub fn insert_debug<T: Debug>(&mut self, name: &str, value: &T)[src]

Convert a value to a string via the fmt::Debug formatter and then insert that into the Artifact with the given string key.

pub fn insert_display<T: Display>(&mut self, name: &str, value: &T)[src]

Convert a value to a string via the fmt::Display formatter and then insert that into the Artifact with the given string key.

pub fn insert_serialize<T: Serialize>(
    &mut self,
    name: &str,
    value: &T
) -> Result<(), ErrorKind>
[src]

Convert a value to a JSON value via serde_json and then insert that into the Artifact with the given string key.

Egress uses serde to do this, so if you want to be able to have nicely formatted diffs between your types, you'll want them to derive serde::{Serialize}.

pub fn insert_json(&mut self, name: &str, json_value: Value)[src]

Insert a JSON Value into the Artifact with the given string key.

Trait Implementations

impl Clone for Artifact[src]

impl Debug for Artifact[src]

impl Default for Artifact[src]

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

impl PartialEq<Artifact> for Artifact[src]

impl Serialize for Artifact[src]

impl StructuralPartialEq for Artifact[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: 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.