libp2p
    Preparing search index...

    Interface ProtobufStream<S>

    Convenience methods for working with protobuf streams

    interface ProtobufStream<S extends MessageStream = MessageStream> {
        pb<T>(
            proto: { decode: ProtobufDecoder<T>; encode: ProtobufEncoder<T> },
        ): ProtobufMessageStream<T, S>;
        read<T>(
            proto: { decode: ProtobufDecoder<T> },
            options?: AbortOptions,
        ): Promise<T>;
        unwrap(): S;
        write<T>(
            data: T,
            proto: { encode: ProtobufEncoder<T> },
            options?: AbortOptions,
        ): Promise<void>;
        writeV<T>(
            input: T[],
            proto: { encode: ProtobufEncoder<T> },
            options?: AbortOptions,
        ): Promise<void>;
    }

    Type Parameters

    Index

    Methods