RpcSerialization.ts overview
Since v1.0.0
Exports Grouped by Category
serialization
Parser (interface)
Signature
export interface Parser {
readonly decode: (data: Uint8Array | string) => ReadonlyArray<unknown>
readonly encode: (response: unknown) => Uint8Array | string
}
Since v1.0.0
RpcSerialization (class)
Signature
declare class RpcSerialization
Since v1.0.0
json
Signature
declare const json: Effect.Effect<any>
Since v1.0.0
layerJson
A rpc serialization layer that uses JSON for serialization.
Use this if your protocol supports framing for messages, otherwise use layerSerializationNdjson
.
Signature
declare const layerJson: Layer.Layer<RpcSerialization>
Since v1.0.0
layerMsgPack
A rpc serialization layer that uses MessagePack for serialization.
MessagePack has a more compact binary format compared to JSON and NDJSON. It also has better support for binary data.
Signature
declare const layerMsgPack: Layer.Layer<RpcSerialization>
Since v1.0.0
layerNdjson
A rpc serialization layer that uses NDJSON for serialization.
Use this if your protocol does not support framing for messages, otherwise use layerSerializationJson
.
Signature
declare const layerNdjson: Layer.Layer<RpcSerialization>
Since v1.0.0
msgPack
Signature
declare const msgPack: any
Since v1.0.0
ndjson
Signature
declare const ndjson: Effect.Effect<any>
Since v1.0.0