Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/willow/mod.universal.ts>Storage3d

Exploring Willow in the most efficient and sound programming language
Go to Latest
interface Storage3d
Re-export
import { type Storage3d } from "https://deno.land/x/willow@0.2.1/mod.universal.ts";

Low-level driver for writing and reading Entries in a three dimensional space.

Type Parameters

NamespaceId
SubspaceId
PayloadDigest
PreFingerprint

Methods

get(subspace: SubspaceId, path: Path): Promise<{ entry: Entry<NamespaceId, SubspaceId, PayloadDigest>; authTokenHash: PayloadDigest; } | undefined>

Retrieve an entry at a subspace and path.

insert(opts: { path: Path; subspace: SubspaceId; payloadDigest: PayloadDigest; timestamp: bigint; length: bigint; authTokenDigest: PayloadDigest; }): Promise<void>

Insert a new entry.

updateAvailablePayload(subspace: SubspaceId, path: Path): Promise<boolean>

Update the available payload bytes for a given entry.

remove(entry: Entry<NamespaceId, SubspaceId, PayloadDigest>): Promise<boolean>

Remove an entry.

summarise(range: Range3d<SubspaceId>): Promise<{ fingerprint: PreFingerprint; size: number; }>

Summarise a given Range3d by mapping the included set of Entry to PreFingerprint.

splitRange(range: Range3d<SubspaceId>, knownSize: number): Promise<[Range3d<SubspaceId>, Range3d<SubspaceId>]>

Split a range into two smaller ranges.

removeInterest(areaOfInterest: AreaOfInterest<SubspaceId>): Promise<Range3d<SubspaceId>>

Return the smallest Range3d which includes all entries included by a given AreaOfInterest.

query(
rangeOfInterest: RangeOfInterest<SubspaceId>,
order: QueryOrder,
reverse?: boolean,
): AsyncIterable<{ entry: Entry<NamespaceId, SubspaceId, PayloadDigest>; authTokenHash: PayloadDigest; }>

Return an async iterator of entries included by a RangeOfInterest.