pub struct TargetRuntimeManager<E>where
E: PluginEvent,{ /* private fields */ }Expand description
Shared runtime container for managing instantiated targets.
This intentionally focuses on low-risk shared lifecycle primitives first: add/remove/close/list/snapshot. Replay workers and reload orchestration can be layered on top in later phases.
Implementations§
Source§impl<E> TargetRuntimeManager<E>where
E: PluginEvent,
impl<E> TargetRuntimeManager<E>where
E: PluginEvent,
pub fn new() -> Self
pub fn add_arc(&mut self, target: SharedTarget<E>) -> Option<SharedTarget<E>>
pub fn add_boxed( &mut self, target: Box<dyn Target<E> + Send + Sync>, ) -> Option<SharedTarget<E>>
pub fn get(&self, key: &str) -> Option<SharedTarget<E>>
pub fn get_by_target_id(&self, target_id: &TargetID) -> Option<SharedTarget<E>>
pub fn remove(&mut self, key: &str) -> Option<SharedTarget<E>>
pub fn remove_by_target_id( &mut self, target_id: &TargetID, ) -> Option<SharedTarget<E>>
pub fn clear(&mut self)
pub async fn remove_and_close(&mut self, key: &str) -> Option<SharedTarget<E>>
pub async fn remove_by_target_id_and_close( &mut self, target_id: &TargetID, ) -> Option<SharedTarget<E>>
Sourcepub async fn clear_and_close(&mut self) -> Vec<(String, TargetError)>
pub async fn clear_and_close(&mut self) -> Vec<(String, TargetError)>
Closes and removes every target, returning the id and error of each target whose close failed. Surfacing them lets a caller fail an explicit shutdown while still tearing down the rest of the runtime.
pub fn target_ids(&self) -> Vec<TargetID>
pub fn keys(&self) -> Vec<String>
pub fn values(&self) -> Vec<SharedTarget<E>> ⓘ
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn snapshots(&self) -> Vec<RuntimeTargetSnapshot>
pub fn status_snapshot( &self, replay_workers: &ReplayWorkerManager, ) -> RuntimeStatusSnapshot
pub async fn health_snapshots(&self) -> Vec<RuntimeTargetHealthSnapshot>
Trait Implementations§
Source§impl<E> Debug for TargetRuntimeManager<E>where
E: PluginEvent,
impl<E> Debug for TargetRuntimeManager<E>where
E: PluginEvent,
Source§impl<E> Default for TargetRuntimeManager<E>where
E: PluginEvent,
impl<E> Default for TargetRuntimeManager<E>where
E: PluginEvent,
Auto Trait Implementations§
impl<E> !RefUnwindSafe for TargetRuntimeManager<E>
impl<E> !UnwindSafe for TargetRuntimeManager<E>
impl<E> Freeze for TargetRuntimeManager<E>
impl<E> Send for TargetRuntimeManager<E>
impl<E> Sync for TargetRuntimeManager<E>
impl<E> Unpin for TargetRuntimeManager<E>
impl<E> UnsafeUnpin for TargetRuntimeManager<E>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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> ⓘ
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 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> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request