Skip to main content

RuntimeConnection

Trait RuntimeConnection 

Source
pub trait RuntimeConnection: Send {
    // Required methods
    fn handle(&self) -> &RuntimeHandle;
    fn send_input<'life0, 'async_trait>(
        &'life0 mut self,
        input: RuntimeInput,
    ) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn next_event<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<HarnessEvent>, Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn interrupt<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn respond<'life0, 'async_trait>(
        &'life0 mut self,
        request_id: Value,
        response: Value,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn close<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Expand description

One connected harness-native runtime session.

Required Methods§

Source

fn handle(&self) -> &RuntimeHandle

Identity and endpoint of this connection.

Source

fn send_input<'life0, 'async_trait>( &'life0 mut self, input: RuntimeInput, ) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Submit structured user input and return the harness-native turn id when one is allocated.

Source

fn next_event<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Option<HarnessEvent>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Wait for the next native live event.

Source

fn interrupt<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Interrupt the current turn, when supported.

Source

fn respond<'life0, 'async_trait>( &'life0 mut self, request_id: Value, response: Value, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Answer a server-initiated protocol request by its native JSON id.

Source

fn close<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Close the adapter-owned transport/process.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§