Skip to main content

ResourceAccessor

Trait ResourceAccessor 

Source
pub trait ResourceAccessor: Send + Sync {
    // Required method
    fn lookup(&self, key: &str) -> Option<Arc<dyn Any + Send + Sync>>;
}
Expand description

Type-erased accessor over the host’s live resource store.

Implemented by the host runtime (nbrs-runtime’s resource pool) and installed into RESOURCE_ACCESSOR. The trait is deliberately minimal and free of host types so polydat stays the dependency floor.

Required Methods§

Source

fn lookup(&self, key: &str) -> Option<Arc<dyn Any + Send + Sync>>

Synchronous lookup of an already-attached resource’s accessor payload by fingerprint key. Returns None when no live entry matches that key (never blocks, never connects).

The key is the host’s stable rendering of a resource fingerprint; a single canonical rendering is shared by whoever installs the payload and whoever looks it up, so the string round-trips exactly.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§