pub trait Resource: 'static {
type Access: AccessFlags;
type Usage: UsageFlags;
type Layout: Copy + Debug + 'static;
// Required methods
fn no_usage() -> Self::Usage;
fn layout_for(access: Self::Access) -> Self::Layout;
}
Expand description
Abstracts resource types that uses different usage flags and layouts types.
Required Associated Types§
Sourcetype Access: AccessFlags
type Access: AccessFlags
Access flags for resource type.
Sourcetype Usage: UsageFlags
type Usage: UsageFlags
Usage flags type for the resource.
Required Methods§
Sourcefn layout_for(access: Self::Access) -> Self::Layout
fn layout_for(access: Self::Access) -> Self::Layout
Layout suitable for specified accesses.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.