Reference

std/storage/memory

std/storage/src/memory.trb

MemoryStorage: the driver of memory:, a table in memory for as long as the driver lives.

type MemoryStorage

shared type MemoryStorage with Storage

memory: - bytes kept in a table for as long as the driver lives, and the double every test of a program that stores things needs: the same trait as the drivers that reach a disk or a network, with nothing to set up and nothing to clean away.

A reference is its whole text (memory:/notes/first), and a directory is only a prefix of other references: memory:/notes exists and lists memory:/notes/first because something is stored below it, and deleting it deletes everything below it.

Examples

fn remembered(): Task<Result<List<Uri>, StorageFailure>> {
  var storage = MemoryStorage()
  storage.writeText("memory:/notes/first", "one").await()?
  storage.writeText("memory:/notes/second", "two").await()?
  storage.list("memory:/notes").await()
}

fn schemes

fn schemes(): List<String>

Not documented.

fn read

fn read(uri: Uri): Task<Result<Bytes, StorageFailure>>

Not documented.

fn exists

fn exists(uri: Uri): Task<Result<Bool, StorageFailure>>

Not documented.

fn list

fn list(uri: Uri): Task<Result<List<Uri>, StorageFailure>>

Not documented.

fn write

var fn write(uri: Uri, content: Bytes): Task<Result<Void, StorageFailure>>

Not documented.

fn delete

var fn delete(uri: Uri): Task<Result<Void, StorageFailure>>

Not documented.