pub trait Assets: Send + Sync + 'static {
    fn get(&self, key: &AssetKey) -> Option<Cow<'_, [u8]>>;
    fn csp_hashes(
        &self,
        html_path: &AssetKey
    ) -> Box<dyn Iterator<Item = CspHash<'_>> + '_>; }
Expand description

Represents a container of file assets that are retrievable during runtime.

Required Methods§

source

fn get(&self, key: &AssetKey) -> Option<Cow<'_, [u8]>>

Get the content of the passed AssetKey.

source

fn csp_hashes(
    &self,
    html_path: &AssetKey
) -> Box<dyn Iterator<Item = CspHash<'_>> + '_>

Gets the hashes for the CSP tag of the HTML on the given path.

Implementors§