pub trait Provider: Send + Sync {
// Required methods
fn manifest(&self) -> &ProviderManifest;
fn open_session<'life0, 'async_trait>(
&'life0 self,
opts: OpenSessionOptions,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn ProviderSession>, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
A provider: a static capability declaration plus a session factory
(spine §4.2 Provider). Providers declare and faithfully execute; they
never fold, translate, improvise, retry, or degrade (04 §1).
Required Methods§
Sourcefn manifest(&self) -> &ProviderManifest
fn manifest(&self) -> &ProviderManifest
The package-shipped static capability declaration.
Sourcefn open_session<'life0, 'async_trait>(
&'life0 self,
opts: OpenSessionOptions,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn ProviderSession>, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn open_session<'life0, 'async_trait>(
&'life0 self,
opts: OpenSessionOptions,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn ProviderSession>, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Opens a session. Atomic (04 §2.1): returning means the connection is
up, the protocol is negotiated with all requiredFeatures satisfied,
the device is selected and connected, the substrate session is
started, and attestation matched lockfileDigest. On any failure the
provider cleans up partial resources and fails — never a half-open
session. Failure classes: negotiation/capability mismatch →
capability_drift; device unavailable → action_failed_retryable;
connection failure → transport_lost.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".