Struct il2_iltags::tags::standard::explicit::ILDictTag [−][src]
pub struct ILDictTag { /* fields omitted */ }
Expand description
This struct implements the standard dictionary tag. It maps strings to tags.
To ensure maximum the stability of the serialized data, the keys are sorted according to the lexicographic order before the serialization.
By default it sets the tag id to IL_DICTIONARY_TAG_ID
.
Implementations
Creates a new instance of this struct with the specified initial value.
Arguments:
value
: A byte slice with the initial value;
Returns an immutable reference to the std::collections::hash_map::HashMap
used to hold the key/value pairs.
Returns a mutable reference to the std::collections::hash_map::HashMap
used to hold the key/value pairs.
Inserts a new pair into this tag. It is a shortcut to:
let ret = tag.mut_value().insert(String::from(k), v);
Arguments:
k
: The key;
v
: The boxed value;
Returns:
Some(old)
: The value of the older value;None
: If it is the first insertion of this key;
Returns an immutable reference to the value associated with a given key. It is a shortcut to:
let ret = match tag.mut_value().get(k) {
Some(t) => Some(t.as_ref()),
None => None,
}
Arguments:
k
: The key;
Returns:
Some(v)
: The value associated with the key;None
: If the key is not inside this tag;
Trait Implementations
Creates a default tag with. Read more
Returns a mutable reference as Any.
Retuns the size of the serialized value in bytes.
Serializes the payload of this tag. Read more
fn deserialize_value(
&mut self,
factory: &dyn ILTagFactory,
value_size: usize,
reader: &mut dyn Reader
) -> Result<()>
fn deserialize_value(
&mut self,
factory: &dyn ILTagFactory,
value_size: usize,
reader: &mut dyn Reader
) -> Result<()>
Deserializes the value. Read more
Verifies if this tag is implicity.
Verifies if this tag is reserved.