Module remoc::codec

source ·
Available on crate feature serde only.
Expand description

Codecs for transforming values into and from binary wire format.

All codecs in this module are wrappers around the serde crates implementing the data representations. Thus you should refer to the corresponding crate documentation for information about limitations and backward as well as forward compatibility.

§Crate features

Each codec is gated by the corresponding crate feature codec-*, i.e. the JSON codec is only available if the crate features codec-json is enabled. The crate feature full-codecs enables all codecs.

The default codec, named Default, can be selected by enabling the appropriate default-codec-* crate feature. For example, if you want to use the JSON codec by default, enable the crate feature default-codec-json. Only one default codec feature must be enabled, otherwise a compile error will occur. The default codec should only be selected by an application and not a library crate that uses Remoc. Otherwise a conflict between multiple libraries that depend upon different default codecs will occur.

The following features select the default codec.

  • default-codec-bincode – enables and selects Bincode as the default codec
  • default-codec-ciborium – enables and selects CBOR as the default codec
  • default-codec-json – enables and selects JSON as the default codec
  • default-codec-message-pack – enables selects MessagePack as the default codec

By default the JSON codec is enabled and the default, i.e. the default-codec-json crate feature is enabled. Thus to change the default codec, you must specify default-features = false when referencing Remoc in your Cargo.toml.

Re-exports§

  • pub use json::Json as Default;

Modules§

Structs§

Traits§

  • Serializes and deserializes items from and to byte data.

Type Aliases§

  • Reference counted error that is send, sync, static and clone.