Module il2_iltags::tags [−][src]
Expand description
This module contains the implementation of the IL2 ILTags standard.
Implicit vs Explicit tags
This library contains 2 types of tags, the implicit and the explicit tags.
The implicit tags have their value lengths predefined. This allows them to be more compact because they do not not store the size of the values in the tag serialization. Only the standard built-in tags with IDs lower than 16 are defined as such.
All tags with ID greater than 15 are considered explicit. Explicit tags encode all fields and have no such limitations.
Standard vs custom tags
The IL2 ILTags standard defined 2 classes of tags, the standard tags and custom tags.
The standard tags are defined by IL2 ILTags and defines most of basic data types that can be used by all applications. The standard tags are reserved by the standard and should not be redefined by applications in order to avoid conflicts with future versions of the standard. All tags with IDs up to 31 are considered reserved.
The custom tags can be freely defined by the applications and must have the ID greater than 31.
Re-exports
pub use serialization::deserialize_bytes;
pub use serialization::deserialize_bytes_into_vec;
pub use serialization::deserialize_ilint;
pub use serialization::serialize_bytes;
pub use serialization::serialize_ilint;
Modules
This module defines the ILGenericPayloadTag
and the trait required to
implement its payload.
This module contains helper struct and functions that allows the parsing of
a serialized sequence of tags. It allows the extraction tag information
from any sequence of bytes without the need to convert it into an
crate::tags::ILTag
instance.
This module implements serializer and deserializer traits. They are similar to
their counterparts from crate::io::data
but returns crate::tags::Result
instead of crate::io::Result
. Furthermore, they also adds the ability to
serialize and deserialize bytes and other usefull data types.
This is module defines all standard tags and tag factories.
This module contains some utility functions that may help the usage and/or implementation of this library.
Structs
This template struct is used to implement the ILTagCreator
trait for all
ILTags
that also implement Default
.
This template struct is used to implement the ILTagCreator
trait for all
ILTags
that also implement DefaultWithId
.
This struct implements a raw tag. It can be used to store any non explicit tag.
This struct implements an engine that maps the ILTagCreators to the associated tag ID. It can be used as a component to implement ILTagFactory trait.
Enums
Definition of the errors from this package.
Constants
Maximum tag id value for implicit tags.
Maximum tag size that can be handled by this library. It in this version it is set to 512MB.
Maximum tag id value for reserved tags.
Traits
This trait defines a variant of the std::default::Default
trait that
takes an id as a parameter.
This trait must be implemented by all ILTags on this library. It defines the basic methods for tag identification, serialization and deserialization of values.
This trait must be implemented by all tag creators. A tag creator is used
by ILTagCreatorEngine
to create new tag instances.
This trait must be implemented by all tag factories. Factories are used to deserialize tags into the most appropriate concreate implemetation that will handle a given tag id.
Functions
Verifies if a given ILTag
has the given tag Id and implements a specified
concrete type.
Verifies if a given ILTag
has the given tag Id and implements a specified
concrete type.
Verifies if a given tag id represents an implicit tag.
Verifies if a given tag id represents a reserved tag.
Downcasts a ILTag
into a mutable a reference to its concrete type.
Downcasts a ILTag
into a mutable a reference to its concrete type if matches
the specified tag Id.
Downcasts a ILTag
into a reference to its concrete type.
Downcasts a ILTag
into a reference to its concrete type it if matches
the specified tag Id.
Downcasts a ILTag
to its concrete type as a mutable reference. It fails
if the tag id or the concrete type does not match.
Downcasts a ILTag
to its concrete type. It fails if the tag id or
the concrete type does not match.
This function converts the tag size as u64 into a usize value. It checks if the tag size falls within the maximum size of a tag that this library accepts.
Type Definitions
A specialized std::result::Result
generated by functions and methods from this package.