pub trait RustEmbed {
    type File: EmbedableFile;

    // Required method
    fn get(file_path: &str) -> Option<Self::File>;
}
Expand description

A folder of embedded files.

The type of the file RustEmbed::File depends on whether we’re in debug mode or release mode:

  • In debug mode it will be a DynamicFile
  • In release mode it will be a EmbeddedFile

The derivation will automatically generate the correct file type. You don’t need to directly interface with the different file types that might get returned: you should instead use the EmbedableFile trait which is implemented for both.

Required Associated Types§

Required Methods§

source

fn get(file_path: &str) -> Option<Self::File>

Get a file out of the folder.

Object Safety§

This trait is not object safe.

Implementors§