Expand description
Infrastructure for type-erased “resource” types, representing interchangeable resources that can be resolved into the same type at runtime.
This allows a device’s resources to be described via mesh
messages so
that the device initialization code does not have to be statically aware of
all the different possible resource types (e.g. via an enum
). VMMs can
link in different resource resolvers to support different resource types
depending on compile-time configuration.
Modules§
- kind
- Resource kind definitions that are used by multiple devices.
Macros§
- declare_
static_ async_ resolver - Declares the resource kinds and types that an async static resolver can resolve.
- declare_
static_ resolver - Declares the resource kinds and types that a static resolver can resolve.
- register_
static_ resolvers - Registers a static resolver, declared via
declare_static_resolver
ordeclare_static_async_resolver
, so that it is automatically available to anyResourceResolver
in the binary.
Structs§
- Platform
Resource - The generic resource defined for all resource kinds.
- Resource
- An opaque resource of kind
K
, for erasing the resource’s type. - Resource
Resolver - A resource resolver capable of resolving resources of multiple types and kinds.
Enums§
- Resolve
Error - An error returned by
ResourceResolver::resolve
.
Traits§
- Async
Resolve Resource - Trait implemented to resolve resource type
T
as resource kindK
. - CanResolve
To - Trait specifying that a
ResourceKind
can be resolved to a given output type. - Into
Resource - Trait for converting resources into opaque
Resource
s. - Resolve
Resource - Trait implemented to resolve resource type
T
as resource kindK
. - Resource
Id - A trait identifying a resource type’s ID (within a given
ResourceKind
). - Resource
Kind - Trait implemented by resource kinds.