Skip to main content

RuntimeCloseOwner

Struct RuntimeCloseOwner 

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

Own every host-supplied runtime clone and its matching registry during eviction.

The host must first stop admitting requests and wait for its active request counter. Transfer the registry built from these runtimes and all host-held clones. A forgotten pool/capability returns Incomplete after teardown has committed; drop that holder and retry. Do not reopen the root until Ok. Configuration Refused results preserve the fully usable Ready state. The bundle retains writer joins across cancelled close futures. Dropping the bundle itself is still best effort, not successful close.

The supported scope is a single backend without embeddings, ANN, blob hydration, split events, or host background tasks. Those owners currently lack a tenant-scoped physical completion barrier and are explicitly refused. A successful return covers the owned audit tasks, SQLite pool/writer and last-store timeout sink; it is not a census of arbitrary host/provider files.

Registry packs and its audit store must belong to the supplied runtime slot. Custom packs must not hide independent file or task owners in this bundle.

Implementations§

Source§

impl RuntimeCloseOwner

Source

pub fn new( registry: VerbRegistry, runtimes: Vec<KhiveRuntime>, host_tasks: RuntimeCloseHostTasks, ) -> Self

Source

pub fn phase(&self) -> RuntimeClosePhase

Source

pub fn open_registry(&self) -> Option<&VerbRegistry>

The registry remains usable after reversible refusal. It is unavailable after teardown commits, including while a close future is cancelled.

Source

pub fn open_runtimes(&self) -> Option<&[KhiveRuntime]>

Transferred handles remain usable after reversible refusal only.

Source

pub fn is_closed(&self) -> bool

Whether close has successfully completed; errors never mark it closed.

Source

pub fn writer_tasks_finished(&self) -> bool

Observe actual writer task completion without aborting or taking a join.

Source

pub async fn close(&mut self) -> Result<(), RuntimeCloseError>

Stop audit admission, await physical append/reaper completion, drop all transferred roots, join the writer, then close the final store’s sink.

Cancellation only interrupts this wait. Retain this owner and call again to resume; no accepted append or native write is aborted. A second call after success returns Ok(()). A permanently stuck native operation can keep close pending; a caller timeout is not evidence of settlement.

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> 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> 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<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