[][src]Struct darkroom::Frame

pub struct Frame<'a> {
    pub protocol: Protocol,
    pub cut: InstructionSet<'a>,
    pub response: Response,
    // some fields omitted
}

Represents the entire deserialized frame file.

Frame spec

Fields

protocol: Protocolcut: InstructionSet<'a>response: Response

Implementations

impl<'a> Frame<'a>[src]

pub fn new(json_string: &str) -> Result<Frame<'_>, FrError>[src]

Creates a new Frame object running post deserialization validations

pub fn to_value(&self) -> Value[src]

Serializes the Frame struct to a serde_json::Value

pub fn get_request(&self) -> Request[src]

Serialized payload

pub fn get_request_uri(&self) -> Result<String, FrError>[src]

Serialized payload

pub fn get_response_value(&self) -> Result<Value, Error>[src]

Returns a Value object from the response body, used for response comparisons and writing to the cut register

pub fn hydrate(&mut self, reg: &Register, hide: bool) -> Result<(), FrError>[src]

Traverses Frame properties where Read Operations are permitted and performs Register.read_operation on Strings with Cut Variables

pub fn hydrate_val(
    set: &InstructionSet<'_>,
    val: &mut Value,
    reg: &Register,
    hide: bool
) -> Result<(), FrError>
[src]

Traverses a given serde::Value enum attempting to modify found Strings for the moment this method also works as a Frame.init() check, emitting FrameParseErrors

Trait Implementations

impl<'a> Clone for Frame<'a>[src]

impl<'a> Debug for Frame<'a>[src]

impl<'de, 'a> Deserialize<'de> for Frame<'a> where
    'de: 'a, 
[src]

impl<'a> PartialEq<Frame<'a>> for Frame<'a>[src]

impl<'a> Serialize for Frame<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Frame<'a>

impl<'a> Send for Frame<'a>

impl<'a> Sync for Frame<'a>

impl<'a> Unpin for Frame<'a>

impl<'a> UnwindSafe for Frame<'a>

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> ToStringHidden for T where
    T: Serialize + ?Sized
[src]

fn to_string_hidden(&self) -> Result<String, FrError>[src]

Pretty formatting for Register serialization, any cut variable names starting with an underscore are presented as ${_HIDDEN} in stdout

impl<T> ToStringPretty for T where
    T: Serialize + ?Sized
[src]

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.