pub enum DynamicString {
Literal(String),
Binding(DataBinding),
Function(FunctionCall),
}Expand description
A value that is either a literal string, a data-binding, or a function call.
JSON representations:
- Literal:
"Hello" - Binding:
{ "path": "/user/name" } - Function:
{ "call": "capitalize", "args": { ... } }
Variants§
Literal(String)
A literal string value.
Binding(DataBinding)
A binding to a data model path.
Function(FunctionCall)
A function call that returns a string.
Implementations§
Source§impl DynamicString
impl DynamicString
Sourcepub fn is_literal(&self) -> bool
pub fn is_literal(&self) -> bool
Returns true if this is a literal string value.
Sourcepub fn as_literal(&self) -> Option<&str>
pub fn as_literal(&self) -> Option<&str>
Returns the literal value if this is a literal, otherwise None.
Trait Implementations§
Source§impl Clone for DynamicString
impl Clone for DynamicString
Source§fn clone(&self) -> DynamicString
fn clone(&self) -> DynamicString
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DynamicString
impl Debug for DynamicString
Source§impl Default for DynamicString
impl Default for DynamicString
Source§impl<'de> Deserialize<'de> for DynamicString
impl<'de> Deserialize<'de> for DynamicString
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&str> for DynamicString
impl From<&str> for DynamicString
Source§impl From<String> for DynamicString
impl From<String> for DynamicString
Source§impl PartialEq for DynamicString
impl PartialEq for DynamicString
Source§fn eq(&self, other: &DynamicString) -> bool
fn eq(&self, other: &DynamicString) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for DynamicString
impl Serialize for DynamicString
impl StructuralPartialEq for DynamicString
Auto Trait Implementations§
impl Freeze for DynamicString
impl RefUnwindSafe for DynamicString
impl Send for DynamicString
impl Sync for DynamicString
impl Unpin for DynamicString
impl UnsafeUnpin for DynamicString
impl UnwindSafe for DynamicString
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