Enum LoginEvent
pub enum LoginEvent<'a> {
Qr {
payload: &'a str,
image_url: Option<&'a str>,
attempt: Option<u32>,
max_attempts: Option<u32>,
},
PairCode {
code: &'a str,
},
Scanned,
Expired {
attempt: u32,
max_attempts: u32,
},
Connected,
Failed {
reason: &'a str,
},
LoggedOut,
}Expand description
A point on the channel-login lifecycle. Construct the variant that
matches the flow state and call LoginEvent::emit.
Variants§
Qr
A fresh QR code is ready to scan.
Fields
PairCode
A phone-number pair code is ready to type into the app.
Scanned
The QR code was scanned; waiting for in-app confirmation.
Expired
The QR code expired; a refresh follows while attempts remain.
Connected
Login confirmed — the channel is connected.
Failed
The login flow gave up (attempts exhausted or fatal error).
LoggedOut
A previously linked session was revoked remotely.
Implementations§
Source§impl LoginEvent<'_>
impl LoginEvent<'_>
Sourcepub fn state(&self) -> &'static str
pub fn state(&self) -> &'static str
Stable attributes.login.state discriminator for this variant.
Sourcepub fn emit(&self, channel_type: &str, channel_alias: &str, message: &str)
pub fn emit(&self, channel_type: &str, channel_alias: &str, message: &str)
Emit this lifecycle point as a structured log event. Live SSE consumers can drive pairing UIs remotely (credentials ride the broadcast-only ephemeral path); JSONL consumers see lifecycle state and identity without the pairing credentials.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for LoginEvent<'a>
impl<'a> RefUnwindSafe for LoginEvent<'a>
impl<'a> Send for LoginEvent<'a>
impl<'a> Sync for LoginEvent<'a>
impl<'a> Unpin for LoginEvent<'a>
impl<'a> UnsafeUnpin for LoginEvent<'a>
impl<'a> UnwindSafe for LoginEvent<'a>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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