pub struct RuntimeEndpoint { /* private fields */ }Expand description
Message-driven runtime endpoint.
Implements Endpoint<AgentEvent, RuntimeInput>. The run is started
lazily when the first RuntimeInput::Run message arrives.
Implementations§
Source§impl RuntimeEndpoint
impl RuntimeEndpoint
Sourcepub fn new(starter: RunStarter) -> Self
pub fn new(starter: RunStarter) -> Self
Create with a run factory that will be invoked on the first Run message.
Sourcepub fn with_buffer(starter: RunStarter, buffer: usize) -> Self
pub fn with_buffer(starter: RunStarter, buffer: usize) -> Self
Create with a run factory and explicit event buffer size.
Sourcepub fn from_run_stream(run: RunStream) -> Self
pub fn from_run_stream(run: RunStream) -> Self
Attach an already-started run (bypasses the Run message).
Useful for tests or contexts where the run was prepared externally.
Sourcepub fn from_run_stream_with_buffer(run: RunStream, buffer: usize) -> Self
pub fn from_run_stream_with_buffer(run: RunStream, buffer: usize) -> Self
Attach an already-started run with explicit buffer size.
Trait Implementations§
Source§impl Endpoint<AgentEvent, RuntimeInput> for RuntimeEndpoint
impl Endpoint<AgentEvent, RuntimeInput> for RuntimeEndpoint
Source§fn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Transport-level close. Does not cancel the run.
fn recv<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BoxStream<AgentEvent>, TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send<'life0, 'async_trait>(
&'life0 self,
item: RuntimeInput,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl !Freeze for RuntimeEndpoint
impl !RefUnwindSafe for RuntimeEndpoint
impl Send for RuntimeEndpoint
impl Sync for RuntimeEndpoint
impl Unpin for RuntimeEndpoint
impl !UnwindSafe for RuntimeEndpoint
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