Module encode

Module encode 

Source
Expand description

Core encoding and decoding traits for the binary protocol.

This module provides traits for serializing and deserializing Rust types to/from the binary IPC protocol.

Structs§

BorrowedFirstArg
Marker type for closures that borrow the first argument.
CallbackKey
Wrapper type that encodes a callback registration key with Callback type info. This tells JS to create a RustFunction wrapper when decoding the value. The type parameter F should be dyn FnMut(...) -> R to capture the callback signature.

Enums§

TypeTag
Type tags for the binary type definition protocol. Used to encode type information that JavaScript can parse to create TypeClass instances.

Traits§

BatchableResult
Trait for return types that can be used in batched JS calls. Determines how the type behaves during batching.
BinaryDecode
Trait for decoding values from the binary protocol. Each type specifies how to deserialize itself.
BinaryEncode
Trait for encoding Rust values into the binary protocol. Each type specifies how to serialize itself.
CloneForEncode
Marker trait for types that can be cheaply cloned for encoding.
EncodeTypeDef
Trait for types that can encode their type definition into the binary protocol. This is used to send type information to JavaScript for callback arguments.
IntoClosure
Trait for converting a closure into a Closure wrapper. This trait is used instead of From to allow blanket implementations for all closure types without conflicting with other From impls. Output is a generic parameter (not associated type) to allow implementing the trait multiple times for the same type with different outputs.