#[non_exhaustive]pub enum DeviceState {
Connecting,
Running,
NeedsLogin(Url),
NeedsMachineAuth,
Reauthenticating,
Expired,
Failed(RegistrationError),
}Expand description
The control-plane lifecycle state of a device.
Published by the control runner as it brings the node up and maintains the netmap stream. A consumer watches this to drive UI (“connecting…”, “needs login”, “expired”) and to distinguish a permanent failure from a transient one without inspecting logs.
#[non_exhaustive]: more lifecycle states may be added (as Reauthenticating was), so an
embedder matching on this must include a wildcard arm and treat an unknown state conservatively
(e.g. as “still coming up”) rather than failing to compile on a fork upgrade. (Same-crate matches
are unaffected — #[non_exhaustive] only forces the wildcard on out-of-crate consumers.)
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Connecting
The runtime has spawned and is registering / establishing the control session. The initial state of every device.
Running
Registered and the netmap stream is live — the node is up.
NeedsLogin(Url)
Control requires interactive authentication (no usable auth key): the node is waiting for a human to authorize it at the carried URL. Transient — registration retries until authorized.
NeedsMachineAuth
The node is registered with a valid key but awaiting admin approval on an approval-gated
tailnet, and control offered no interactive auth URL (so, unlike
NeedsLogin, there is nothing for a human to open — an admin must approve
the node out of band). Transient — treated like Connecting by the
waiters (wait_until_running keeps waiting, never
settling on it); the runtime polls registration and, once an admin approves, auto-transitions
to Running with no re-registration (Go’s ipn.State::NeedsMachineAuth →
Starting). No browse_to_url is derived from it (there is no URL).
Reauthenticating
The node key expired and an automatic, non-interactive re-authentication is in progress: the
runtime is rotating the node key and re-registering with the stored auth key (Go doLogin).
Transient — treated like Connecting by the waiters
(wait_until_running keeps waiting, never settling on
it), and the next good self-node flips the state back to Running. No
browse_to_url is derived from it (the recovery is non-interactive, unlike
NeedsLogin). Entered only when an auth key is retained, auto-reauth is
enabled, and Tailnet Lock enforcement is NOT active; otherwise the runtime falls through to
Expired. See the runtime’s expiry_action for the decision matrix.
Expired
The node key has expired (control reported the self-node’s key expiry is in the past). The node must re-authenticate to continue. Surfaced from the netmap self-node, not registration.
Failed(RegistrationError)
Registration hard-failed with a permanent reason (e.g. a bad/expired/unknown auth key). The control runner stops; this carries the typed reason. Not retried.
Trait Implementations§
Source§impl Clone for DeviceState
impl Clone for DeviceState
Source§fn clone(&self) -> DeviceState
fn clone(&self) -> DeviceState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DeviceState
impl Debug for DeviceState
impl Eq for DeviceState
Source§impl PartialEq for DeviceState
impl PartialEq for DeviceState
Source§fn eq(&self, other: &DeviceState) -> bool
fn eq(&self, other: &DeviceState) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DeviceState
Auto Trait Implementations§
impl Freeze for DeviceState
impl RefUnwindSafe for DeviceState
impl Send for DeviceState
impl Sync for DeviceState
impl Unpin for DeviceState
impl UnsafeUnpin for DeviceState
impl UnwindSafe for DeviceState
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<A, T> DynMessage<A> for T
impl<A, T> DynMessage<A> for T
Source§fn handle_dyn<'a>(
self: Box<T>,
state: &'a mut A,
actor_ref: ActorRef<A>,
tx: Option<Sender<Result<Box<dyn Any + Send>, SendError<Box<dyn Any + Send>, Box<dyn Any + Send>>>>>,
stop: &'a mut bool,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn ReplyError>>> + Send + 'a>>
fn handle_dyn<'a>( self: Box<T>, state: &'a mut A, actor_ref: ActorRef<A>, tx: Option<Sender<Result<Box<dyn Any + Send>, SendError<Box<dyn Any + Send>, Box<dyn Any + Send>>>>>, stop: &'a mut bool, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn ReplyError>>> + Send + 'a>>
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
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
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>
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>
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