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§
Sourcefn handle(&self) -> &RuntimeHandle
fn handle(&self) -> &RuntimeHandle
Identity and endpoint of this connection.
Sourcefn 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 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.
Sourcefn 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 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.
Sourcefn 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 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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".