#[non_exhaustive]pub enum StartReason {
New,
Resumed,
Reloaded,
Restarted,
}Expand description
Why the agent process started, which the launcher passes in
env::START. A switch to another session (/new, /resume) starts
it as New or Resumed; a crash is no reason, since the launcher
never restarts a crashed agent.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
New
The session’s first start: a new session, or /new.
Resumed
A session that ran before: rig --resume, or /resume switching
to it.
Reloaded
The same session again after /reload or a plugin’s reload exit.
Restarted
The same session again on the previous build, after the launcher rolled back a new build that stopped during startup.
Implementations§
Source§impl StartReason
impl StartReason
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
Its text in env::START.
Sourcepub fn from_env() -> Option<Self>
pub fn from_env() -> Option<Self>
The reason in env::START, or None when it is unset or not one.
Trait Implementations§
Source§impl Clone for StartReason
impl Clone for StartReason
impl Copy for StartReason
Source§impl Debug for StartReason
impl Debug for StartReason
impl Eq for StartReason
Source§impl FromStr for StartReason
impl FromStr for StartReason
Source§impl Hash for StartReason
impl Hash for StartReason
Source§impl PartialEq for StartReason
impl PartialEq for StartReason
impl StructuralPartialEq for StartReason
Auto Trait Implementations§
impl Freeze for StartReason
impl RefUnwindSafe for StartReason
impl Send for StartReason
impl Sync for StartReason
impl Unpin for StartReason
impl UnsafeUnpin for StartReason
impl UnwindSafe for StartReason
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