Skip to main content

RealtimeSessionController

Struct RealtimeSessionController 

Source
pub struct RealtimeSessionController { /* private fields */ }
Expand description

Holds realtime session controller application-layer state or configuration. Use it with the documented coordinator methods; run, journal, event, provider, or port effects are called out on those methods rather than on construction.

Implementations§

Source§

impl RealtimeSessionController

Source

pub fn new( sidecar: RealtimeSessionSidecar, adapter: Arc<dyn RealtimeProviderAdapter>, journal: Arc<dyn RunJournal>, run_id: RunId, agent_id: AgentId, source: SourceRef, runtime_package_fingerprint: impl Into<String>, ) -> Self

Creates a new application::realtime value with explicit caller-provided inputs. This constructor is data-only and performs no I/O or external side effects.

Source

pub fn connect(&mut self) -> Result<RealtimeSessionRecord, AgentError>

Connect. This appends realtime connection intent/result records through the journal path and calls the configured realtime adapter to open the session.

Source

pub fn send( &mut self, frame: RealtimeInputFrame, ) -> Result<RealtimeSessionRecord, AgentError>

Send. This journals the realtime send path and forwards one frame to the configured realtime adapter.

Source

pub fn receive(&mut self) -> Result<Option<RealtimeSessionRecord>, AgentError>

Receives one realtime output frame through the configured adapter. This records a receive request, calls the adapter, appends a received record when output is available, and updates the in-memory session cursor.

Source

pub fn interrupt( &mut self, response_id: impl Into<String>, ) -> Result<RealtimeSessionRecord, AgentError>

Interrupt. This records the interrupt path and sends the configured realtime interruption frame to the adapter session.

Source

pub fn begin_restart( &mut self, ) -> Result<Vec<RealtimeSessionRecord>, AgentError>

Marks the active realtime session as beginning a restart. This appends restart-requested and restart-started records and updates session state; the adapter restart call happens in complete_restart.

Source

pub fn complete_restart( &mut self, ) -> Result<Vec<RealtimeSessionRecord>, AgentError>

Complete restart. This records restart completion and updates session state after the adapter reports success.

Source

pub fn close( &mut self, reason: RealtimeCloseReason, ) -> Result<RealtimeSessionRecord, AgentError>

Close. This journals close intent/result and calls the realtime adapter to close the active session.

Trait Implementations§

Source§

impl Clone for RealtimeSessionController

Source§

fn clone(&self) -> RealtimeSessionController

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.