Skip to main content

RuntimeBackend

Trait RuntimeBackend 

Source
pub trait RuntimeBackend: Send + Sync {
    // Required methods
    fn harness(&self) -> HarnessId;
    fn capabilities(&self) -> RuntimeCapabilities;
    fn start<'life0, 'async_trait>(
        &'life0 self,
        request: RuntimeStartRequest,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn RuntimeConnection>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn attach<'life0, 'async_trait>(
        &'life0 self,
        request: RuntimeAttachRequest,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn RuntimeConnection>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn attach_existing<'life0, 'async_trait>(
        &'life0 self,
        _request: RuntimeAttachRequest,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn RuntimeConnection>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Factory for starting, resuming, and (where the native protocol permits it) joining one harness’s already-running runtime endpoint.

Required Methods§

Source

fn harness(&self) -> HarnessId

Harness implemented by this backend.

Source

fn capabilities(&self) -> RuntimeCapabilities

Honest mechanical capability report.

Source

fn start<'life0, 'async_trait>( &'life0 self, request: RuntimeStartRequest, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn RuntimeConnection>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create a fresh harness-native session.

Source

fn attach<'life0, 'async_trait>( &'life0 self, request: RuntimeAttachRequest, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn RuntimeConnection>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Resume a persisted harness-native session through a new protocol connection. This does not imply joining the process that originally wrote the session.

Provided Methods§

Source

fn attach_existing<'life0, 'async_trait>( &'life0 self, _request: RuntimeAttachRequest, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn RuntimeConnection>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Join an already-running harness process or server. Most stock harnesses cannot do this; adapters must opt in rather than silently treating a persisted resume as a live attach.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§