Options
All
  • Public
  • Public/Protected
  • All
Menu

DataTape is a file or stream that consists of a sequence of Data packets. This type implements DataStore interfaces on top of such a file or stream.

Hierarchy

  • DataTape

Implements

Index

Constructors

constructor

  • Constructor.

    Parameters

    • stream: string | ReadableStream | WritableStream | OpenStream

      a readable/writable stream, a function to (re)open the stream, or a filename.

      If stream is a stream (instead of a function or a filename), only one method may be called once. Otherwise, methods can be called, but they must be sequenced because this type is non-thread-safe.

      DataTape.Reader methods are available only if the stream is readable. DataTape.Writer methods are available only if the stream is writable.

    Returns DataTape

Methods

close

  • close(): Promise<void>

find

  • find(interest: Interest): Promise<undefined | Data>

get

  • get(name: Name): Promise<undefined | Data>

insert

  • insert(...args: (Data | AnyIterable<Data>)[] | [{}, ...(Data | AnyIterable<Data>)[]]): Promise<void>
  • Insert one or more Data packets.

    Arguments include:

    • an optional Options object
    • zero or more Data, Iterable, or AsyncIterable

    Parameters

    • Rest ...args: (Data | AnyIterable<Data>)[] | [{}, ...(Data | AnyIterable<Data>)[]]

    Returns Promise<void>

listData

  • listData(prefix?: Name): AsyncIterable<Data>

listNames

  • listNames(prefix?: Name): AsyncIterable<Name>

Generated using TypeDoc