Skip to main content

open_mem

Function open_mem 

Source
pub fn open_mem(uri_str: &str) -> Result<Box<dyn BytesSource>>
Expand description

Open a mem://<id> URI as a BytesSource. 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 each MemReader owns its own position, while the bytes themselves are reference-counted via Arc. Large mem:// buffers (e.g. pre-loaded test fixtures or in-memory transcode roundtrip targets) therefore cost a single Arc clone per open instead of a full Vec<u8> copy.