Skip to main content

ResourceFilesCollection

Trait ResourceFilesCollection 

Source
pub trait ResourceFilesCollection {
    type Resource: ResourceFile;

    // Required methods
    fn get_resource(&self, path: &str) -> Option<&Self::Resource>;
    fn contains_key(&self, path: &str) -> bool;
}
Expand description

Basic abstraction for a dictionary of resources.

Required Associated Types§

Required Methods§

Source

fn get_resource(&self, path: &str) -> Option<&Self::Resource>

Get a resource by path

Source

fn contains_key(&self, path: &str) -> bool

Check if a resource exists by path

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl ResourceFilesCollection for HashMap<&'static str, Resource>

Source§

type Resource = Resource

Source§

fn get_resource(&self, path: &str) -> Option<&Self::Resource>

Source§

fn contains_key(&self, path: &str) -> bool

Source§

impl<R> ResourceFilesCollection for Arc<R>

Source§

impl<R> ResourceFilesCollection for Rc<R>

Implementors§