Struct liquid::model::Object [−][src]
pub struct Object { /* fields omitted */ }
Expand description
Type representing a Liquid object, payload of the Value::Object
variant
Implementations
Returns a reference to the value corresponding to the key.
The key may be any borrowed form of the map’s key type, but the ordering on the borrowed form must match the ordering on the key type.
Returns true if the map contains a value for the specified key.
The key may be any borrowed form of the map’s key type, but the ordering on the borrowed form must match the ordering on the key type.
Returns a mutable reference to the value corresponding to the key.
The key may be any borrowed form of the map’s key type, but the ordering on the borrowed form must match the ordering on the key type.
Inserts a key-value pair into the map.
If the map did not have this key present, None
is returned.
If the map did have this key present, the value is updated, and the old value is returned.
Removes a key from the map, returning the value at the key if the key was previously in the map.
The key may be any borrowed form of the map’s key type, but the ordering on the borrowed form must match the ordering on the key type.
Gets the given key’s corresponding entry in the map for in-place manipulation.
Gets an iterator over the entries of the map.
Gets a mutable iterator over the entries of the map.
Gets an iterator over the keys of the map.
Gets an iterator over the values of the map.
Trait Implementations
pub fn deserialize<D>(
deserializer: D
) -> Result<Object, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
pub fn deserialize<D>(
deserializer: D
) -> Result<Object, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Extends a collection with the contents of an iterator. Read more
extend_one
)Extends a collection with exactly one element.
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Access an element of this map. Panics if the given key is not present in the map.
match *val {
Value::Scalar(ref s) => Some(s.to_kstr()),
Value::Array(ref arr) => Some(arr[0].to_kstr()),
Value::Object(ref map) => Some(map["type"].to_kstr()),
_ => None,
}
Mutably access an element of this map. Panics if the given key is not present in the map.
map["key"] = liquid_core::value!("value");
Keys available for lookup.
Keys available for lookup.
Returns an iterator .
Access a contained BoxedValue
.
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
pub 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
A Display
for a BoxedValue
rendered for the user.
A Display
for a Value
as source code.
Query the value’s state
Interpret as a string.
Extracts the object value if it is a object.
Auto Trait Implementations
impl RefUnwindSafe for Object
impl UnwindSafe for Object
Blanket Implementations
Mutably borrows from an owned value. Read more