Module api

Source
Expand description

APIs for producing and using archived data.

§Accessing byte slices

The safety requirements for accessing a byte slice will often state that a byte slice must “represent a valid archived type”. The specific validity requirements may vary widely depending on the types being accessed, and so in general the only way to guarantee that this call is safe is to have previously validated the byte slice.

Using techniques such as cryptographic signing can provide a more performant way to verify data integrity from trusted sources.

It is generally safe to assume that unchanged and properly-aligned serialized bytes are always safe to access without validation. By contrast, bytes from a potentially-malicious source should always be validated prior to access.

Modules§

highalloc
APIs for environments where allocations can be made.
low
APIs for environments where allocations cannot be made.

Functions§

access_pos_unchecked
Access a byte slice with a given root position.
access_pos_unchecked_mut
Mutably access a byte slice with a given root position.
access_pos_with_contextbytecheck
Access a byte slice with a given root position and context.
access_unchecked
Access a byte slice.
access_unchecked_mut
Mutably access a byte slice.
access_with_contextbytecheck
Access a byte slice with a given context.
check_pos_with_contextbytecheck
Check a byte slice with a given root position and context.
deserialize_using
Deserialize a value using the given deserializer.
root_position
Return the position of the root within a buffer of length bytes.
serialize_using
Serialize a value using the given serializer.