[−][src]Struct egress::Artifact
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 Entry
s.
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]
&mut self,
name: &str,
value: &T
) -> Result<(), ErrorKind>
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]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl PartialEq<Artifact> for Artifact
[src]
impl Serialize for Artifact
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for Artifact
[src]
Auto Trait Implementations
impl RefUnwindSafe for Artifact
impl Send for Artifact
impl Sync for Artifact
impl Unpin for Artifact
impl UnwindSafe for Artifact
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,