pub struct SupervisionTreeHandle { /* private fields */ }Expand description
A read-only handle for taking snapshots of a supervision tree.
Obtained from Supervisor::tree_handle. Cheap to clone, safe to share across
tasks and threads, and deliberately incapable of anything but observation – it cannot spawn children or
otherwise affect the tree it reports on.
A handle can be taken before the supervisor starts, and remains valid across every restart of it.
Implementations§
Source§impl SupervisionTreeHandle
impl SupervisionTreeHandle
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Returns the identifier of the supervisor at the root of this handle’s view.
Sourcepub fn snapshot_json(&self) -> String
pub fn snapshot_json(&self) -> String
Renders the current state of the supervision tree as pretty-printed JSON.
Returns a JSON object describing the failure if the tree can’t be serialized, so that a caller writing a diagnostic artifact always has something to write.
Sourcepub fn api_handler(&self) -> SupervisionTreeAPIHandler
pub fn api_handler(&self) -> SupervisionTreeAPIHandler
Creates a SupervisionTreeAPIHandler serving snapshots of this tree.
Sourcepub fn worker(&self) -> SupervisionTreeWorker
pub fn worker(&self) -> SupervisionTreeWorker
Creates a SupervisionTreeWorker that publishes this tree over the control plane.
Sourcepub fn snapshot(&self) -> TreeSnapshot
pub fn snapshot(&self) -> TreeSnapshot
Captures the current state of the supervision tree.
Descends from this handle’s supervisor through every child, nesting each child’s own children beneath it.
§Consistency
The tree is read one supervisor at a time, so a snapshot is not a globally atomic view: a child may start or exit while the walk is in progress, and the result then mixes observations from slightly different instants. This is deliberate. Reading the whole tree atomically would mean holding every supervisor’s bookkeeping at once, which would let an operator-facing diagnostics call stall supervision across the entire process – a far worse property than a snapshot whose nodes are microseconds apart.
Trait Implementations§
Source§impl Clone for SupervisionTreeHandle
impl Clone for SupervisionTreeHandle
Source§fn clone(&self) -> SupervisionTreeHandle
fn clone(&self) -> SupervisionTreeHandle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SupervisionTreeHandle
impl RefUnwindSafe for SupervisionTreeHandle
impl Send for SupervisionTreeHandle
impl Sync for SupervisionTreeHandle
impl Unpin for SupervisionTreeHandle
impl UnwindSafe for SupervisionTreeHandle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Track for T
impl<T> Track for T
§fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
Tracked wrapper. Read more§fn in_current_resource_group(self) -> Tracked<Self>
fn in_current_resource_group(self) -> Tracked<Self>
Tracked wrapper. Read more