Crate vm_resource
source ·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§
- Resource kind definitions that are used by multiple devices.
Macros§
- Declares the resource kinds and types that an async static resolver can resolve.
- Declares the resource kinds and types that a static resolver can resolve.
- 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§
- The generic resource defined for all resource kinds.
- An opaque resource of kind
K
, for erasing the resource’s type. - A resource resolver capable of resolving resources of multiple types and kinds.
Enums§
- An error returned by
ResourceResolver::resolve
.
Traits§
- Trait implemented to resolve resource type
T
as resource kindK
. - Trait specifying that a
ResourceKind
can be resolved to a given output type. - Trait for converting resources into opaque
Resource
s. - Trait implemented to resolve resource type
T
as resource kindK
. - A trait identifying a resource type’s ID (within a given
ResourceKind
). - Trait implemented by resource kinds.