Skip to main content

Files

Trait Files 

Source
pub trait Files {
    // Required method
    fn contents(&self, name: &str) -> Option<Vec<u8>>;
}
Expand description

Where the contents of a declared file come from.

The loader does no file I/O of its own: a plugin’s manifest lists the files it wants to see, and whoever owns the project (the engine) decides how to read them, with what limits, and what a failure means. This trait is that seam – and the reason a plugin can never reach past the names it declared, because this is the only way it can ask.

Required Methods§

Source

fn contents(&self, name: &str) -> Option<Vec<u8>>

The contents of one file, or None when there is nothing to hand over.

Called at most once per name per call.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§