pub trait AnyResource<const T: usize>: ResourceBase<T> {
const NAME: &str;
const RESOURCE_VARIETY: usize = T;
}Expand description
Trait for expressing any version of resource: either v0::Resource
or v1::Resource.
A requirement for a resource of any variety may be expressed as:
struct ContainsAResource<T: comprehensive::AnyResource<U>, const U: usize> {
resource: std::sync::Arc<T>,
}Required Associated Constants§
Provided Associated Constants§
Sourceconst RESOURCE_VARIETY: usize = T
const RESOURCE_VARIETY: usize = T
The const generic parameter of this Resource. Occasionally
necessary for hinting whicg variety of Resource is being supplied
to meet a T: AnyResource<U> bound.
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.