Library storage

To use this library in your code:

import system.storage
User-space side of the service API for storage.
Examples
Store and read a value in a RAM-backed bucket. The used memory survives deep sleep, but not a restart of the device due to a reset or power loss.

import system.storage

main:
  bucket := storage.Bucket.open --ram "my-bucket"
  bucket["key"] = "value"
  print bucket["key"]
Use a 128 byte region in flash to store binary data.

import system.storage

main:
  region := storage.Region.open --flash "my-region" --capacity=128
  region.write --at=0 #[0x12, 0x34]

Classes

A storage bucket is a key-value mapping that resides outside the current process and that can be persisted across application and device restarts.

A storage region is a sequence of stored bytes that reside outside the current process and that can be persisted across application and device restarts.