pub struct ProvidedResources<B> {
pub provider: String,
pub node_identity: String,
pub resources: BTreeMap<ResourceId, MmioResource>,
pub ceiling: BTreeMap<ResourceId, ResourceCeiling>,
pub backends: BTreeMap<ResourceId, B>,
}Expand description
Everything one provider acquired for the bound node.
Fields§
§provider: StringProvider kind, for example "platform", "embedded", or "fake". Feeds the
per-resource digests.
node_identity: StringStable node identity criteria (for example the node moniker), never a per-boot numeric ID. Feeds the per-resource digests.
resources: BTreeMap<ResourceId, MmioResource>Logical resource descriptions, keyed by resource ordinal.
ceiling: BTreeMap<ResourceId, ResourceCeiling>Immutable ceiling entries. A resource with no entry permits nothing.
backends: BTreeMap<ResourceId, B>One backend per offered resource.
Implementations§
Source§impl<B> ProvidedResources<B>
impl<B> ProvidedResources<B>
Sourcepub fn empty(provider: &str, node_identity: &str) -> Self
pub fn empty(provider: &str, node_identity: &str) -> Self
An empty bundle: no resources, nothing reachable.
Sourcepub fn embedded(node_identity: &str) -> Self
pub fn embedded(node_identity: &str) -> Self
Creates an empty bundle for an embedded in-situ driver library.
Sourcepub fn add_mmio(
&mut self,
id: ResourceId,
name: impl Into<String>,
logical_size: u64,
mapped_size: u64,
ceiling: ResourceCeiling,
backend: B,
)
pub fn add_mmio( &mut self, id: ResourceId, name: impl Into<String>, logical_size: u64, mapped_size: u64, ceiling: ResourceCeiling, backend: B, )
Registers a pre-mapped MMIO bank with its logical size, actual mapped size, target ceiling policy, and backend.
Sourcepub fn add_protocol(
&mut self,
id: ResourceId,
name: impl Into<String>,
kind: ResourceKind,
ceiling: ProtocolCeiling,
backend: B,
)
pub fn add_protocol( &mut self, id: ResourceId, name: impl Into<String>, kind: ResourceKind, ceiling: ProtocolCeiling, backend: B, )
Registers a protocol-backed resource (GPIO, I2C, SPI, Clock, Reset, Serial).
Sourcepub fn add_interrupt(
&mut self,
id: ResourceId,
name: impl Into<String>,
backend: B,
)
pub fn add_interrupt( &mut self, id: ResourceId, name: impl Into<String>, backend: B, )
Registers an interrupt observation resource.
Sourcepub fn validate(&self) -> Result<(), ProviderError>
pub fn validate(&self) -> Result<(), ProviderError>
Validates internal consistency. Driver start fails on error.
Sourcepub fn digests(&self) -> BTreeMap<ResourceId, Sha256Digest>
pub fn digests(&self) -> BTreeMap<ResourceId, Sha256Digest>
Per-resource digests for this bundle, in ascending resource ID order.
Sourcepub fn combined_digest(&self) -> Sha256Digest
pub fn combined_digest(&self) -> Sha256Digest
The whole-instance resource digest for this bundle.