Skip to main content

named_source_from_bytes

Function named_source_from_bytes 

Source
pub fn named_source_from_bytes(
    name: impl AsRef<str>,
    bytes: &[u8],
) -> NamedSource<Arc<[u8]>>
Expand description

Build a NamedSource from a name and raw bytes.

The bytes are cloned into an Arc<[u8]> via miette’s constructor, so callers may drop the original slice after this returns.