Skip to main content

Layout

Trait Layout 

Source
pub trait Layout: Send + Sync {
    type Resource: Send + 'static;
    type ExtendedResource: Send + 'static;

    // Required methods
    fn get_resource(
        &self,
        root: &Path,
        resource: Self::Resource,
    ) -> Option<PathBuf>;
    fn get_extended_resource(
        &self,
        root: &Path,
        resource: Self::ExtendedResource,
    ) -> Option<PathBuf>;
    fn name(&self) -> &'static str;

    // Provided methods
    fn try_get_resource(
        &self,
        root: &Path,
        resource: Self::Resource,
    ) -> Result<PathBuf>
       where Self::Resource: Debug { ... }
    fn try_get_extended_resource(
        &self,
        root: &Path,
        resource: Self::ExtendedResource,
    ) -> Result<PathBuf>
       where Self::ExtendedResource: Debug { ... }
}

Required Associated Types§

Source

type Resource: Send + 'static

Source

type ExtendedResource: Send + 'static

Required Methods§

Source

fn get_resource(&self, root: &Path, resource: Self::Resource) -> Option<PathBuf>

Source

fn get_extended_resource( &self, root: &Path, resource: Self::ExtendedResource, ) -> Option<PathBuf>

Source

fn name(&self) -> &'static str

Provided Methods§

Source

fn try_get_resource( &self, root: &Path, resource: Self::Resource, ) -> Result<PathBuf>
where Self::Resource: Debug,

Source

fn try_get_extended_resource( &self, root: &Path, resource: Self::ExtendedResource, ) -> Result<PathBuf>
where Self::ExtendedResource: Debug,

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Layout for ()

Source§

type Resource = ()

Source§

type ExtendedResource = ()

Source§

fn get_resource( &self, _root: &Path, _resource: Self::Resource, ) -> Option<PathBuf>

Source§

fn get_extended_resource( &self, _root: &Path, _resource: Self::ExtendedResource, ) -> Option<PathBuf>

Source§

fn name(&self) -> &'static str

Implementors§