import { type Storage3d } from "https://deno.land/x/willow@0.2.1/mod.deno.ts";
Low-level driver for writing and reading Entries in a three dimensional space.
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(): AsyncIterable<{ entry: Entry<NamespaceId, SubspaceId, PayloadDigest>; authTokenHash: PayloadDigest; }>
Return an async iterator of entries included by a RangeOfInterest
.