pub struct CodingCliHarness {
pub spec: CodingCliHarnessSpec,
pub vendors: VendorRegistry,
pub isolator: Arc<dyn Isolator>,
pub store: Arc<dyn CliRunStore>,
pub bus: EventBus,
/* private fields */
}Fields§
§spec: CodingCliHarnessSpec§vendors: VendorRegistry§isolator: Arc<dyn Isolator>§store: Arc<dyn CliRunStore>§bus: EventBusImplementations§
Source§impl CodingCliHarness
impl CodingCliHarness
pub fn new( spec: CodingCliHarnessSpec, vendors: VendorRegistry, isolator: Arc<dyn Isolator>, store: Arc<dyn CliRunStore>, ) -> Self
Sourcepub fn local_default() -> Self
pub fn local_default() -> Self
Shortcut: in-memory store + default vendors + local isolator.
Sourcepub fn events(&self) -> CodingCliEventStream
pub fn events(&self) -> CodingCliEventStream
Subscribe to the normalized event stream.
Sourcepub fn event_sender(&self) -> Sender<CodingCliEvent>
pub fn event_sender(&self) -> Sender<CodingCliEvent>
Clone the broadcast sender — the web companion does this so its SSE handler can subscribe.
Sourcepub fn available_vendors(&self) -> Vec<CliVendorKind>
pub fn available_vendors(&self) -> Vec<CliVendorKind>
List vendor kinds wired into this harness.
pub fn sessions(&self) -> &SessionRegistry
Sourcepub async fn run(&self, req: CliRequest) -> Result<CliResult, HarnessError>
pub async fn run(&self, req: CliRequest) -> Result<CliResult, HarnessError>
Drive one request to completion.
Sourcepub async fn start_interactive(
&self,
req: CliRequest,
) -> Result<Arc<InteractiveSessionHandle>, HarnessError>
pub async fn start_interactive( &self, req: CliRequest, ) -> Result<Arc<InteractiveSessionHandle>, HarnessError>
Spawn an interactive session and register it. Returns the new
CliSessionId; clients should connect to
WS /api/cli/sessions/{id}/io (in the web companion) to drive it.
Sourcepub async fn stop_interactive(
&self,
id: &CliSessionId,
) -> Result<(), HarnessError>
pub async fn stop_interactive( &self, id: &CliSessionId, ) -> Result<(), HarnessError>
Stop an interactive session and remove it from the registry.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for CodingCliHarness
impl !UnwindSafe for CodingCliHarness
impl Freeze for CodingCliHarness
impl Send for CodingCliHarness
impl Sync for CodingCliHarness
impl Unpin for CodingCliHarness
impl UnsafeUnpin for CodingCliHarness
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.