pub trait SubstrateRead {
// Required methods
fn capabilities(&self) -> Capabilities;
fn grains_of_type(
&self,
grain_type: &str,
namespace: Option<&str>,
opts: ReadOpts,
) -> Result<Vec<GrainRecord>>;
fn grain(&self, hash: &str) -> Result<Option<GrainRecord>>;
// Provided methods
fn heads(&self, _namespace: Option<&str>) -> Result<Vec<HeadGroup>> { ... }
fn telemetry(
&self,
_namespace: Option<&str>,
) -> Result<Option<TelemetryView>> { ... }
}Expand description
The read-only slice of the substrate. Analyzers receive this (via
AnalyzeCtx) and nothing else — the trust floor’s “analyzers execute
read-only” is enforced by the type system: a &dyn SubstrateRead cannot
reach any mutating method. It is object-safe (no generics) so
builtin_analyzers() can hand out Box<dyn Analyzer>.
Required Methods§
Sourcefn capabilities(&self) -> Capabilities
fn capabilities(&self) -> Capabilities
Declared optional capabilities.
Sourcefn grains_of_type(
&self,
grain_type: &str,
namespace: Option<&str>,
opts: ReadOpts,
) -> Result<Vec<GrainRecord>>
fn grains_of_type( &self, grain_type: &str, namespace: Option<&str>, opts: ReadOpts, ) -> Result<Vec<GrainRecord>>
Curated read: all grains of one OMS type, optionally namespace-scoped and watermark/liveness filtered.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".