Expand description
Built-in mem:// driver — in-memory synthetic byte buffers.
A process-global registry maps a string identifier to an Arc<Vec<u8>>;
mem://<id> opens the buffer as a BytesSource. Useful for tests
and for pipelines that want to feed pre-baked bytes through the same
open(uri) shape they use for files.
The scheme has no on-wire spec — it is internal-to-OxideAV. Grammar (informal):
mem://<id>where <id> is any byte sequence excluding /. Empty <id> is
rejected (we want a non-ambiguous “default buffer” form to remain
available for future use).
Functions§
- clear
- Drop every registered
mem://entry. Intended for test teardown. - open_
mem - Open a
mem://<id>URI as aBytesSource. Each open returns an independent reader over the same shared buffer — no per-open copy. Readers and seekers do not interfere with each other because eachMemReaderowns its own position, while the bytes themselves are reference-counted viaArc. Largemem://buffers (e.g. pre-loaded test fixtures or in-memory transcode roundtrip targets) therefore cost a singleArcclone peropeninstead of a fullVec<u8>copy. - put
- Install a buffer at
mem://<id>. Replaces any prior entry under the same id. The buffer is held by reference; concurrent opens share it without copying. - remove
- Remove an entry. Returns
trueif a buffer was present.