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§
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>
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".