Skip to main content

asset_bytes

Function asset_bytes 

Source
pub fn asset_bytes<A: Embed>(name: &str) -> Option<Bytes>
Expand description

Load raw bytes from the embedded dist directory. Returns None if missing.

Returns Bytes rather than Vec<u8> so callers do not copy the file; Bytes derefs to [u8] and converts into a response Body for free.