#[non_exhaustive]pub enum Event {
Show 19 variants
CapabilitiesAcknowledged {
names: Vec<String>,
},
Registered {
nick: String,
},
IsupportToken {
token: String,
value: Option<String>,
},
LoggedIn {
account: String,
},
SaslFailed {
reason: SaslFailure,
},
NickInUse {
refused: String,
trying: String,
},
ModelChanged {
change: Change,
},
LinkDead,
ReconnectAfter {
after_ms: u64,
},
ReconnectAbandoned,
CommandTimedOut {
command: String,
},
AllowedCommandsChanged,
BotsChanged {
nick: String,
},
AuthToken {
service: String,
endpoint: String,
token: String,
},
Voice {
channel: String,
signal: Signal,
},
TypingChanged {
target: String,
nick: String,
active: bool,
},
PresenceChanged {
nick: String,
online: bool,
},
ServerReply {
severity: Severity,
command: String,
code: String,
context: Vec<String>,
text: String,
},
RawLine {
message: Message,
},
}Expand description
Something the host needs to know about.
Events are drained with Client::poll_event rather than delivered through a callback, because
a callback needs a different lifetime, threading and re-entrancy contract in every language this
engine is bound into.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
CapabilitiesAcknowledged
A capability was acknowledged, and whatever it enables is now live.
Registered
Registration finished. 001 arrived and the nick is settled.
Fields
IsupportToken
An ISUPPORT token arrived. Emitted per token so a host can react to one without diffing.
Fields
LoggedIn
Authentication succeeded.
SaslFailed
Authentication did not succeed. Registration continues unauthenticated.
Fields
reason: SaslFailureWhy it ended.
NickInUse
The server refused a nick and the engine is trying another.
ModelChanged
The model changed.
LinkDead
The link went quiet for too long and should be treated as dead. The host closes its socket
and waits for Event::ReconnectAfter.
ReconnectAfter
Time to open a new connection. The host dials and calls Client::handle_connected.
ReconnectAbandoned
Reconnecting has been given up on after too many attempts.
CommandTimedOut
A command we labelled never got its reply.
AllowedCommandsChanged
The set of commands the server allows us changed.
BotsChanged
What we know about a bot changed. Read it back from Client::bots.
AuthToken
The server minted a bearer token for one of its services.
Fields
Voice
A voice signalling frame arrived, and the room state has already been updated for it.
The host handles the media plane: this carries the session descriptions and candidates it needs, and nothing that touches a track.
TypingChanged
Someone started or stopped composing a message.
Fields
PresenceChanged
Someone we watch came online or went offline.
ServerReply
The server reported the outcome of something, through standard-replies.
Fields
RawLine
A line arrived that the engine has no dedicated handling for yet. Everything is surfaced, so a host is never blind to traffic the engine does not model.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Event
impl<'de> Deserialize<'de> for Event
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Event
impl StructuralPartialEq for Event
Source§impl TS for Event
impl TS for Event
Source§const DOCS: Option<&'static str>
const DOCS: Option<&'static str>
TS is derived, docs are
automatically read from your doc comments or #[doc = ".."] attributesSource§type WithoutGenerics = Event
type WithoutGenerics = Event
WithoutGenerics should just be Self.
If the type does have generic parameters, then all generic parameters must be replaced with
a dummy type, e.g ts_rs::Dummy or ().
The only requirement for these dummy types is that EXPORT_TO must be None. Read moreSource§fn decl_concrete() -> String
fn decl_concrete() -> String
TS::decl().
If this type is not generic, then this function is equivalent to TS::decl().Source§fn decl() -> String
fn decl() -> String
type User = { user_id: number, ... }.
This function will panic if the type has no declaration. Read moreSource§fn inline() -> String
fn inline() -> String
{ user_id: number }.
This function will panic if the type cannot be inlined.Source§fn inline_flattened() -> String
fn inline_flattened() -> String
This function will panic if the type cannot be flattened.
Source§fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn output_path() -> Option<&'static Path>
fn output_path() -> Option<&'static Path>
T should be exported.The returned path does not include the base directory from
TS_RS_EXPORT_DIR. Read moreSource§fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
§fn dependencies() -> Vec<Dependency>where
Self: 'static,
fn dependencies() -> Vec<Dependency>where
Self: 'static,
§fn export() -> Result<(), ExportError>where
Self: 'static,
fn export() -> Result<(), ExportError>where
Self: 'static,
TS::export_all]. Read more§fn export_all() -> Result<(), ExportError>where
Self: 'static,
fn export_all() -> Result<(), ExportError>where
Self: 'static,
To export only this type, without its dependencies, use [
TS::export]. Read more§fn export_all_to(out_dir: impl AsRef<Path>) -> Result<(), ExportError>where
Self: 'static,
fn export_all_to(out_dir: impl AsRef<Path>) -> Result<(), ExportError>where
Self: 'static,
To export only this type, without its dependencies, use [
TS::export]. Read more§fn export_to_string() -> Result<String, ExportError>where
Self: 'static,
fn export_to_string() -> Result<String, ExportError>where
Self: 'static,
§fn default_output_path() -> Option<PathBuf>
fn default_output_path() -> Option<PathBuf>
T should be exported. Read more