[−][src]Struct darkroom::Register
Holds Cut Variables and their corresponding values stored in a series of key/value pairs.
Implementations
impl Register
[src]
pub fn from<T>(json_string: T) -> Result<Register, FrError> where
T: AsRef<str>,
[src]
T: AsRef<str>,
Creates a Register from a string ref
pub fn new() -> Register
[src]
pub fn to_string_pretty(&self) -> String
[src]
Pretty json formatting for Register serialization
[src]
Pretty formatting for Register serialization, any variables starting with an underscore as it's value hidden
pub fn get_key_value<K>(&self, key: K) -> Option<(&String, &Value)> where
K: AsRef<str>,
[src]
K: AsRef<str>,
Gets a reference to the string slice value for the given var name.
pub fn get<K>(&self, key: K) -> Option<&Value> where
K: AsRef<str>,
[src]
K: AsRef<str>,
Gets a reference to the string slice value for the given var name.
pub fn iter(&self) -> Iter<String, Value>
[src]
An iterator visiting all Cut Variables in arbitrary order.
pub fn contains_key(&self, key: &str) -> bool
[src]
Returns a boolean indicating whether Register.vars contains a given key.
pub fn destructive_merge<I>(&mut self, others: I) where
I: IntoIterator<Item = Register>,
[src]
I: IntoIterator<Item = Register>,
Merges a foreign Cut register into the caller, overriding any values in self with other
pub fn read_match(&self, json_string: &str) -> Result<Vec<Match>, FrError>
[src]
Returns a vector of Match enums enums found in the string provided for use in cut operations.
pub fn read_operation(
&self,
mat: Match,
value: &mut Value,
hide_vars: bool
) -> Result<(), FrError>
[src]
&self,
mat: Match,
value: &mut Value,
hide_vars: bool
) -> Result<(), FrError>
Replaces a byte range in a given string with the range given in the ::Match provided.
pub fn expect_standalone_var(
var_name: &str,
frame_str: &str
) -> Result<(), FrError>
[src]
var_name: &str,
frame_str: &str
) -> Result<(), FrError>
pub fn write_match(
var_name: &str,
frame_str: &str,
payload_str: &str
) -> Result<Option<String>, FrError>
[src]
var_name: &str,
frame_str: &str,
payload_str: &str
) -> Result<Option<String>, FrError>
Takes a frame string value and compares it against a payload string value returning any declared cut variables found
pub fn write_operation(
&mut self,
key: &str,
val: Value
) -> Result<Option<Value>, FrError>
[src]
&mut self,
key: &str,
val: Value
) -> Result<Option<Value>, FrError>
Inserts a Value entry into the Register's Cut Variables
Returns an Err if the key value is does not consist solely of characters, dashes, and underscores.
pub fn flush_ignored(&mut self)
[src]
Flushes lowercase/ignored variable patters
Trait Implementations
impl Clone for Register
[src]
impl Debug for Register
[src]
impl Default for Register
[src]
impl<'de> Deserialize<'de> for Register
[src]
fn deserialize<__D>(
__deserializer: __D
) -> Result<Register, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
__deserializer: __D
) -> Result<Register, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
impl PartialEq<Register> for Register
[src]
impl Serialize for Register
[src]
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
impl StructuralPartialEq for Register
[src]
Auto Trait Implementations
impl RefUnwindSafe for Register
impl Send for Register
impl Sync for Register
impl Unpin for Register
impl UnwindSafe for Register
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: for<'de> Deserialize<'de>,
[src]
T: for<'de> 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>,