Struct il2_iltags::tags::standard::explicit::ILStrDictTag[][src]

pub struct ILStrDictTag { /* fields omitted */ }
Expand description

This struct implements the standard string dictionary tag. It always maps strings to strings.

This tag is binary compatible with the implementation of ILDictTag however, this implementation is optimized to handle strings and offer easier ways to deal with them.

By default it sets the tag id to IL_STRING_DICTIONARY_TAG_ID.

Implementations

Creates a new instance of this struct.

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.

Returns the number of pairs inside this tag.

Returns true if this tag is empty or false otherwise.

Inserts a new pair into this tag. It is a shortcut to:

let ret = tag.mut_value().insert(String::from(k), String::from(v));

Arguments: k: The key; v: The 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

Returns the “default value” for a type. Read more

Creates a default tag with. Read more

Returns the ID of the tag.

Returns a reference as Any.

Returns a mutable reference as Any.

Retuns the size of the serialized value in bytes.

Serializes the payload of this tag. Read more

Deserializes the value. Read more

Verifies if this tag is implicity.

Verifies if this tag is reserved.

Returns the total size of the tag in bytes.

Serializes this tag. Read more

Serializes the given tag into an array of bytes. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.