pub struct NodeStatusTracker { /* private fields */ }Expand description
Node status tracker with state machine
Implementations§
Source§impl NodeStatusTracker
impl NodeStatusTracker
Sourcepub fn new(config: StateMachineConfig) -> Self
pub fn new(config: StateMachineConfig) -> Self
Create a new node status tracker
Sourcepub async fn register_node(&self, node_id: OxirsNodeId)
pub async fn register_node(&self, node_id: OxirsNodeId)
Register a new node
Sourcepub async fn unregister_node(&self, node_id: &OxirsNodeId)
pub async fn unregister_node(&self, node_id: &OxirsNodeId)
Unregister a node
Sourcepub async fn transition_state(
&self,
node_id: OxirsNodeId,
new_state: NodeState,
reason: String,
) -> Result<(), String>
pub async fn transition_state( &self, node_id: OxirsNodeId, new_state: NodeState, reason: String, ) -> Result<(), String>
Transition node to a new state
Sourcepub async fn get_node_status(&self, node_id: &OxirsNodeId) -> Option<NodeStatus>
pub async fn get_node_status(&self, node_id: &OxirsNodeId) -> Option<NodeStatus>
Get node status
Sourcepub async fn get_all_statuses(&self) -> BTreeMap<OxirsNodeId, NodeStatus>
pub async fn get_all_statuses(&self) -> BTreeMap<OxirsNodeId, NodeStatus>
Get all node statuses
Sourcepub async fn get_nodes_in_state(&self, state: NodeState) -> Vec<OxirsNodeId> ⓘ
pub async fn get_nodes_in_state(&self, state: NodeState) -> Vec<OxirsNodeId> ⓘ
Get nodes in a specific state
Sourcepub async fn get_transition_history(&self) -> Vec<StateTransition>
pub async fn get_transition_history(&self) -> Vec<StateTransition>
Get transition history
Sourcepub async fn get_node_transition_history(
&self,
node_id: &OxirsNodeId,
) -> Vec<StateTransition>
pub async fn get_node_transition_history( &self, node_id: &OxirsNodeId, ) -> Vec<StateTransition>
Get transition history for a specific node
Sourcepub async fn update_metadata(
&self,
node_id: &OxirsNodeId,
key: String,
value: String,
) -> Result<(), String>
pub async fn update_metadata( &self, node_id: &OxirsNodeId, key: String, value: String, ) -> Result<(), String>
Update node metadata
Sourcepub async fn get_stats(&self) -> StateMachineStats
pub async fn get_stats(&self) -> StateMachineStats
Get statistics
Sourcepub async fn perform_auto_checks(&self)
pub async fn perform_auto_checks(&self)
Perform automatic state checks
Auto Trait Implementations§
impl !RefUnwindSafe for NodeStatusTracker
impl !UnwindSafe for NodeStatusTracker
impl Freeze for NodeStatusTracker
impl Send for NodeStatusTracker
impl Sync for NodeStatusTracker
impl Unpin for NodeStatusTracker
impl UnsafeUnpin for NodeStatusTracker
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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 moreimpl<T> MaybeDebug for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.