Skip to main content Link Search Menu Expand Document (external link)

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
}

Source

Since v1.0.0

RpcSerialization (class)

Signature

declare class RpcSerialization

Source

Since v1.0.0

json

Signature

declare const json: Effect.Effect<any>

Source

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>

Source

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>

Source

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>

Source

Since v1.0.0

msgPack

Signature

declare const msgPack: any

Source

Since v1.0.0

ndjson

Signature

declare const ndjson: Effect.Effect<any>

Source

Since v1.0.0