Skip to main content

RuntimeState

Struct RuntimeState 

Source
pub struct RuntimeState {
    pub web_viewer: ViewerControl,
    /* private fields */
}

Fields§

§web_viewer: ViewerControl

Implementations§

Source§

impl RuntimeState

Source

pub async fn prepare_move_session( self: &Arc<Self>, selection: MoveSelection, ) -> Result<MovePreparation>

Source

pub async fn move_session( self: &Arc<Self>, request: MoveSessionRequest, ) -> Result<MoveOutcome>

Source§

impl RuntimeState

Source

pub fn review_host(&self) -> &TurnReviewHost

The review host, for the surfaces that project and resolve reviews.

Source

pub fn allocate_revision(&self) -> u64

Source

pub fn publish_web_access(&self, access: WebViewerAccess)

Source

pub fn revisions(&self) -> Receiver<u64>

Source

pub fn with_config<T>(&self, read: impl FnOnce(&Config) -> T) -> T

Read the config the daemon serves right now. A task on a schedule reads it again on every tick, so a reload reaches it without a restart.

Source

pub async fn create_quick_bundle( &self, source: String, ) -> Result<QuickBundleCreation, QuickBundleFailure>

Create a bundle under the daemon’s config-mutation coordinator. The controller helper also takes the cross-process config lock, so a TUI transaction cannot race this one while the daemon’s other config writers are excluded by this mutex.

Source

pub async fn reload_controller(&self) -> Result<()>

Source

pub async fn start_subagent_session( self: &Arc<Self>, request: RegisterSubagentRequest, ) -> Result<SubagentRecord>

Register and start a child worker on its parent’s existing target.

Source

pub async fn start_create_session_controlled( self: &Arc<Self>, request: CreateSessionRequest, control: CreateSessionControl, publication: Receiver<Result<(), String>>, ) -> Result<RegisteredSession>

Source

pub async fn wait_create_session(&self, session_id: &str) -> Result<()>

Source

pub fn request_close(&self, session_id: &str)

Source

pub fn clear_close_request(&self, session_id: &str)

Source

pub fn close_is_requested(&self, session_id: &str) -> bool

Source

pub async fn close_session(self: &Arc<Self>, session_id: String) -> Result<()>

Source

pub async fn resume_session( self: &Arc<Self>, request: ResumeSessionRequest, ) -> Result<()>

Resume a session, and return nothing.

This used to answer with the whole MaterializedSession. That reply travels as one JSON frame against MAX_FRAME_BYTES, so a session whose projection outgrew 8 MiB could not be resumed at all — it built a several-hundred-megabyte buffer and then refused to send it. The projection is already durable; a viewer reads it from the store.

Source

pub async fn force_destroy_session( self: &Arc<Self>, session_id: String, ) -> Result<()>

Permanently destroy a session from any state, cancelling whatever lifecycle operation holds it first. Data loss is the caller’s confirmed decision; see Controller::force_destroy_session.

Source

pub async fn force_delete_workspace( self: &Arc<Self>, workspace_id: String, ) -> Result<()>

Force-delete a workspace: destroy every active session in it (see RuntimeState::force_destroy_session), drop its detached drafts, and remove the workspace row. Stopped histories stay globally resumable.

In-flight resumes into the workspace still refuse the deletion because they have not yet claimed a durable session workspace. A session that fails to destroy stops the sequence with the remainder named, so the operation can be retried without losing progress.

Source

pub fn active_lifecycles(&self) -> Vec<RuntimeLifecycleView>

Every lifecycle operation running now.

The dashboard receives these through a watch channel built by its own poller, which the phone server does not have; rather than plumb that channel through the session-manager handle, the phone loop reads the same state directly. The read is a mutex acquisition over a small map, and it happens once per published snapshot, so it never blocks the loop the way an await on the async snapshot path would.

Source

pub fn session_state(&self, session_id: &str) -> Option<SessionState>

The lifecycle state of one in-memory record, or None when the daemon holds no record for it. Reading one field costs one lock rather than a clone of every record, which is what a poll wants.

Source

pub fn session_record(&self, session_id: &str) -> Option<SessionRecord>

One in-memory session record, or None when the daemon holds none.

Source

pub async fn workspace_session_handle( &self, session_id: &str, ) -> Result<ManagedSessionHandle>

Source

pub async fn checkpoint_session_now( &self, session_id: &str, ) -> Result<CheckpointMetadata>

Checkpoint a session now and publish the result, the way the daemon’s own checkpoint action does.

The API’s bundle export needs a fresh archive for a running session, and it must take the same lifecycle guard and controller refresh as any other checkpoint rather than driving the controller behind their backs.

Source

pub fn session_projection( &self, ) -> (BTreeMap<String, SessionRecord>, Vec<RuntimeLifecycleView>)

In-memory records and ownership sampled with the same lock order as completion. A web publish must not pair old records with a new absence of ownership, even while its background database reload is in flight.

Source

pub fn cancel_lifecycle_if_active(&self, session_id: &str)

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> IntoMaybeUndefined<T> for T

Source§

fn into_maybe_undefined(self) -> MaybeUndefined<T>

Converts this value into a three-state builder argument.
Source§

impl<T> IntoOption<T> for T

Source§

fn into_option(self) -> Option<T>

Converts this value into an optional builder argument.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more