Skip to main content

Module memory

Module memory 

Source
Expand description

Memory: an in-memory mount with exact versions, for tests and scratch trees.

It is also the reference for the conformance suite: where HostDir is best effort (versions, watch latency) Memory is exact, so a behaviour difference between the two is either a declared Caps difference or a bug.

  • if_version is exact: the check and the change happen under one lock.
  • watch is immediate (WatchKind::Native): the batch is queued before the writing call returns.
  • Versions are a counter made unique per instance (an instance number and a random part in its high bits), so a version from one Memory never validates against another. A directory’s version changes whenever an entry is added to, removed from or renamed in it (and may change more often).
  • No ownership or mode (owner_mode is false), no hard links, no symlinks; nothing to escape from.

MemoryOptions can switch capabilities off so the suite can prove a backend that declares a capability false really returns Unsupported for it.

Structs§

Memory
An in-memory mount. Cheap to clone: clones share one tree. See the module docs.
MemoryOptions
Which optional capabilities a Memory provides. The default is all of them.