pub struct Io {
pub bootstrap_io: Arc<dyn BootstrapIo>,
pub factory: Arc<dyn RuntimeFactory>,
pub package_handler: Arc<dyn PackageHandler>,
pub package_output: Arc<dyn PackageOutput>,
pub dispatcher: Arc<DefaultDispatcher>,
}Expand description
Injectable process I/O and product runtime dependencies.
Fields§
§bootstrap_io: Arc<dyn BootstrapIo>Bootstrap environment and terminal operations.
factory: Arc<dyn RuntimeFactory>Runtime factory.
package_handler: Arc<dyn PackageHandler>Package-command handler.
package_output: Arc<dyn PackageOutput>Package-command output sink.
dispatcher: Arc<DefaultDispatcher>Mode dispatcher (concrete so runners can be replaced).
Implementations§
Source§impl Io
impl Io
Sourcepub fn real() -> Self
pub fn real() -> Self
Production wiring backed by real product services.
Constructs a RuntimeFactory that chains
create_agent_session_services → create_agent_session_from_services →
AgentSessionRuntime, a PackageHandler backed by PackageManager,
and a DefaultDispatcher with concrete print/json binding.
RPC and interactive closures are injected by the caller when those mode
runners are available (the RPC server and interactive TUI are built by
sibling slices). Use Io::with_rpc / Io::with_interactive to
inject them.
Sourcepub fn with_rpc<F>(self, f: F) -> Selfwhere
F: Fn(Dispatched, Arc<AgentSessionRuntime>) -> BoxFuture<'static, Result<u8, String>> + Send + Sync + 'static,
pub fn with_rpc<F>(self, f: F) -> Selfwhere
F: Fn(Dispatched, Arc<AgentSessionRuntime>) -> BoxFuture<'static, Result<u8, String>> + Send + Sync + 'static,
Inject the RPC mode runner.
Sourcepub fn with_interactive<F>(self, f: F) -> Selfwhere
F: Fn(Dispatched, Arc<AgentSessionRuntime>) -> BoxFuture<'static, Result<u8, String>> + Send + Sync + 'static,
pub fn with_interactive<F>(self, f: F) -> Selfwhere
F: Fn(Dispatched, Arc<AgentSessionRuntime>) -> BoxFuture<'static, Result<u8, String>> + Send + Sync + 'static,
Inject the interactive mode runner.
Sourcepub fn custom(
bootstrap_io: Arc<dyn BootstrapIo>,
factory: Arc<dyn RuntimeFactory>,
package_handler: Arc<dyn PackageHandler>,
package_output: Arc<dyn PackageOutput>,
dispatcher: Arc<DefaultDispatcher>,
) -> Self
pub fn custom( bootstrap_io: Arc<dyn BootstrapIo>, factory: Arc<dyn RuntimeFactory>, package_handler: Arc<dyn PackageHandler>, package_output: Arc<dyn PackageOutput>, dispatcher: Arc<DefaultDispatcher>, ) -> Self
Test/custom wiring with full injection.
Auto Trait Implementations§
impl !RefUnwindSafe for Io
impl !Send for Io
impl !Sync for Io
impl !UnwindSafe for Io
impl Freeze for Io
impl Unpin for Io
impl UnsafeUnpin for Io
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more