pub struct OpenCodeRuntimeBackend { /* private fields */ }Expand description
OpenCode live-runtime backend using its official HTTP API and SSE event
stream. OpenCodeRuntimeBackend::connect can join the server embedded in
an already-running TUI when that TUI was launched with a known host/port.
Implementations§
Source§impl OpenCodeRuntimeBackend
impl OpenCodeRuntimeBackend
Sourcepub fn new() -> OpenCodeRuntimeBackend
pub fn new() -> OpenCodeRuntimeBackend
Launch a fresh opencode serve process for each connection.
Sourcepub fn connect(base_url: impl Into<String>) -> OpenCodeRuntimeBackend
pub fn connect(base_url: impl Into<String>) -> OpenCodeRuntimeBackend
Connect to an existing OpenCode server, including a TUI’s server when it was launched on a known address.
Sourcepub fn with_launch(self, launch: RuntimeLaunch) -> OpenCodeRuntimeBackend
pub fn with_launch(self, launch: RuntimeLaunch) -> OpenCodeRuntimeBackend
Override the command used when launching a new OpenCode server.
Trait Implementations§
Source§impl Clone for OpenCodeRuntimeBackend
impl Clone for OpenCodeRuntimeBackend
Source§fn clone(&self) -> OpenCodeRuntimeBackend
fn clone(&self) -> OpenCodeRuntimeBackend
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OpenCodeRuntimeBackend
impl Debug for OpenCodeRuntimeBackend
Source§impl Default for OpenCodeRuntimeBackend
impl Default for OpenCodeRuntimeBackend
Source§fn default() -> OpenCodeRuntimeBackend
fn default() -> OpenCodeRuntimeBackend
Returns the “default value” for a type. Read more
Source§impl RuntimeBackend for OpenCodeRuntimeBackend
impl RuntimeBackend for OpenCodeRuntimeBackend
Source§fn capabilities(&self) -> RuntimeCapabilities
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>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
OpenCodeRuntimeBackend: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 self,
request: RuntimeStartRequest,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn RuntimeConnection>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
OpenCodeRuntimeBackend: '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>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
OpenCodeRuntimeBackend: 'async_trait,
fn attach<'life0, 'async_trait>(
&'life0 self,
request: RuntimeAttachRequest,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn RuntimeConnection>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
OpenCodeRuntimeBackend: '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.
Source§fn attach_existing<'life0, 'async_trait>(
&'life0 self,
request: RuntimeAttachRequest,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn RuntimeConnection>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
OpenCodeRuntimeBackend: 'async_trait,
fn attach_existing<'life0, 'async_trait>(
&'life0 self,
request: RuntimeAttachRequest,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn RuntimeConnection>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
OpenCodeRuntimeBackend: '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.
Auto Trait Implementations§
impl Freeze for OpenCodeRuntimeBackend
impl RefUnwindSafe for OpenCodeRuntimeBackend
impl Send for OpenCodeRuntimeBackend
impl Sync for OpenCodeRuntimeBackend
impl Unpin for OpenCodeRuntimeBackend
impl UnsafeUnpin for OpenCodeRuntimeBackend
impl UnwindSafe for OpenCodeRuntimeBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more