pub struct Frame<'a> {
pub protocol: Protocol,
pub cut: InstructionSet<'a>,
pub response: Response<'a>,
/* private fields */
}
Expand description
Represents the entire deserialized frame file.
Fields§
§protocol: Protocol
§cut: InstructionSet<'a>
§response: Response<'a>
Implementations§
source§impl<'a> Frame<'a>
impl<'a> Frame<'a>
sourcepub fn new(json_string: &str) -> Result<Frame<'a>, FrError>
pub fn new(json_string: &str) -> Result<Frame<'a>, FrError>
Creates a new Frame object running post deserialization validations
sourcepub fn get_request(&self) -> Request
pub fn get_request(&self) -> Request
Serialized payload
sourcepub fn get_request_uri(&self) -> Result<String, FrError>
pub fn get_request_uri(&self) -> Result<String, FrError>
Serialized payload
sourcepub fn get_response_value(&self) -> Result<Value, Error>
pub fn get_response_value(&self) -> Result<Value, Error>
Returns a Value object from the response body, used for response comparisons and writing to the cut register
sourcepub fn hydrate(&mut self, reg: &Register, hide: bool) -> Result<(), FrError>
pub fn hydrate(&mut self, reg: &Register, hide: bool) -> Result<(), FrError>
Traverses Frame properties where Read Operations are permitted and performs Register.read_operation on Strings with Cut Variables
sourcepub fn hydrate_val(
set: &InstructionSet<'_>,
val: &mut Value,
reg: &Register,
hide: bool
) -> Result<(), FrError>
pub fn hydrate_val( set: &InstructionSet<'_>, val: &mut Value, reg: &Register, hide: bool ) -> Result<(), FrError>
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§
source§impl<'de, 'a> Deserialize<'de> for Frame<'a>
impl<'de, 'a> Deserialize<'de> for Frame<'a>
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Frame<'a>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Frame<'a>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<'a> PartialEq for Frame<'a>
impl<'a> PartialEq for Frame<'a>
source§impl<'a> Serialize for Frame<'a>
impl<'a> Serialize for Frame<'a>
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'a> StructuralPartialEq for Frame<'a>
Auto Trait Implementations§
impl<'a> Freeze for Frame<'a>
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> ToStringHidden for T
impl<T> ToStringHidden for T
Pretty formatting for Register serialization, any cut variable names starting with an underscore are
presented as ${_HIDDEN}
in stdout