pub enum HostStatus {
InScope,
Failed,
}Expand description
Represents the operational status of a host within the Genja runtime.
This enum tracks whether a host is currently available for operations or has
been marked as failed. Hosts can transition between these states using the
State::mark_failed and State::mark_in_scope methods.
§Variants
-
InScope- The host is available and can participate in operations. This is the default state for hosts that have not been explicitly marked as failed. -
Failed- The host has been marked as failed and will be excluded from operations until it is explicitly restored to theInScopestate.
§Examples
let state = State::new();
// Check the status of a host
assert_eq!(state.host_status("router1"), None); // Untracked hosts return None
// Mark a host as failed
state.mark_failed("router1");
assert_eq!(state.host_status("router1"), Some(HostStatus::Failed));
// Restore the host to in-scope status
state.mark_in_scope("router1");
assert_eq!(state.host_status("router1"), Some(HostStatus::InScope));Variants§
Trait Implementations§
Source§impl Clone for HostStatus
impl Clone for HostStatus
Source§fn clone(&self) -> HostStatus
fn clone(&self) -> HostStatus
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for HostStatus
Source§impl Debug for HostStatus
impl Debug for HostStatus
Source§impl Default for HostStatus
impl Default for HostStatus
Source§fn default() -> HostStatus
fn default() -> HostStatus
Returns the “default value” for a type. Read more
impl Eq for HostStatus
Source§impl PartialEq for HostStatus
impl PartialEq for HostStatus
Source§fn eq(&self, other: &HostStatus) -> bool
fn eq(&self, other: &HostStatus) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for HostStatus
Auto Trait Implementations§
impl Freeze for HostStatus
impl RefUnwindSafe for HostStatus
impl Send for HostStatus
impl Sync for HostStatus
impl Unpin for HostStatus
impl UnsafeUnpin for HostStatus
impl UnwindSafe for HostStatus
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.