Skip to main content

Command

Enum Command 

Source
#[non_exhaustive]
pub enum Command {
Show 28 variants Join { channel: String, key: Option<String>, }, Part { channel: String, reason: Option<String>, }, SendMessage { target: String, text: String, }, SendNotice { target: String, text: String, }, SendAction { target: String, text: String, }, SetNick { nick: String, }, SetTopic { channel: String, topic: Option<String>, }, SetAway { message: Option<String>, }, SetTyping { target: String, state: Typing, }, AddReaction { target: String, msgid: String, emoji: String, }, RemoveReaction { target: String, msgid: String, emoji: String, }, RedactMessage { target: String, msgid: String, reason: Option<String>, }, MarkRead { target: String, at_ms: u64, }, FetchHistory { target: String, before_msgid: Option<String>, limit: u16, }, SetMetadata { key: String, value: Option<String>, }, SubscribeMetadata { keys: Vec<String>, }, Whois { nick: String, }, RenameChannel { channel: String, new_name: String, reason: Option<String>, }, CreateInviteLink { channel: Option<String>, description: Option<String>, }, ListInviteLinks, DeleteInviteLink { share_id: String, }, RedeemInviteCode { code: String, }, GenerateToken { service: String, }, WatchNicks { nicks: Vec<String>, }, UnwatchNicks { nicks: Vec<String>, }, SendVoiceSignal { channel: String, signal: Signal, }, Quit { reason: Option<String>, }, SendRawLine { line: String, },
}
Expand description

Something to do on this connection.

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.
§

Join

Join a channel.

Fields

§channel: String

The channel to join.

§key: Option<String>

Its key, when it has one.

§

Part

Leave a channel.

Fields

§channel: String

The channel to leave.

§reason: Option<String>

Why, shown to the others in it.

§

SendMessage

Say something to a channel or a person.

Fields

§target: String

Where to say it.

§text: String

What to say.

§

SendNotice

Send a notice, which by convention must never be auto-replied to.

Fields

§target: String

Where to send it.

§text: String

What to send.

§

SendAction

Send a CTCP ACTION, the third-person form.

Fields

§target: String

Where to send it.

§text: String

What we are doing.

§

SetNick

Change our nick.

Fields

§nick: String

The nick to take.

§

SetTopic

Set or clear a channel topic.

Fields

§channel: String

The channel.

§topic: Option<String>

The new topic, or nothing to clear it.

§

SetAway

Mark ourselves away, or come back.

Fields

§message: Option<String>

The away message, or nothing to come back.

§

SetTyping

Say we are typing, so others can show it.

Fields

§target: String

Who we are typing to.

§state: Typing

How far along we are.

§

AddReaction

React to a message with an emoji.

Fields

§target: String

The channel or person the message is in.

§msgid: String

The message reacted to.

§emoji: String

The emoji.

§

RemoveReaction

Take a reaction back.

Fields

§target: String

The channel or person the message is in.

§msgid: String

The message.

§emoji: String

The emoji to remove.

§

RedactMessage

Ask the server to delete a message.

Fields

§target: String

Where the message is.

§msgid: String

The message to delete.

§reason: Option<String>

Why, when the server wants a reason.

§

MarkRead

Tell the server how far we have read.

Fields

§target: String

The channel or person.

§at_ms: u64

The last message read, in milliseconds since the Unix epoch. The engine writes the server-time the wire wants.

§

FetchHistory

Ask for older messages than the ones we hold.

With no before_msgid, this asks for the most recent, which is what a fresh window wants.

Fields

§target: String

The channel or person.

§before_msgid: Option<String>

Fetch messages older than the message with this id.

§limit: u16

How many to ask for.

§

SetMetadata

Set one of our own metadata keys, or clear it.

Fields

§key: String

The key, such as display-name, color or avatar.

§value: Option<String>

The value, or nothing to clear the key.

§

SubscribeMetadata

Ask to be told when these metadata keys change on anyone we can see.

Fields

§keys: Vec<String>

The keys to watch.

§

Whois

Ask the server everything it will say about someone.

The reply is nine numerics; the engine collects them and reports the whole record once.

Fields

§nick: String

Who to ask about.

§

RenameChannel

Rename a channel, keeping everyone in it and everything said in it.

Fields

§channel: String

The channel as it is called now.

§new_name: String

What to call it.

§reason: Option<String>

Why, shown to the others in it.

Make an invitation link to a channel, or to the network when no channel is named.

Fields

§channel: Option<String>

The channel it joins, or nothing to invite to the network.

§description: Option<String>

What it is for.

Ask for the invitation links we have made.

Withdraw an invitation link.

Fields

§share_id: String

Which one, from Command::ListInviteLinks.

§

RedeemInviteCode

Redeem an invitation code. Only before registering, which is the point of it.

Fields

§code: String

The code, which is the share id of the link that carried it.

§

GenerateToken

Mint a bearer token for one of the network’s services, such as its file host.

Fields

§service: String

Which service the token is for, such as FILEHOST.

§

WatchNicks

Watch these nicks, so the server says when they come and go.

Fields

§nicks: Vec<String>

The nicks to watch.

§

UnwatchNicks

Stop watching these nicks.

Fields

§nicks: Vec<String>

The nicks to stop watching.

§

SendVoiceSignal

Send a voice signalling frame to a room.

The frame is the host’s to build, because everything in it comes from the media stack the core deliberately knows nothing about.

Fields

§channel: String

The channel to signal in.

§signal: Signal

The frame. The engine encodes it as the JSON that travels in the tag.

§

Quit

Leave the network.

Fields

§reason: Option<String>

Why.

§

SendRawLine

Send a line we do not model. The escape hatch, so a host is never stuck waiting for us.

Fields

§line: String

The line, without its terminator.

Trait Implementations§

Source§

impl Clone for Command

Source§

fn clone(&self) -> Command

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Command

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Command

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for Command

Source§

impl PartialEq for Command

Source§

fn eq(&self, other: &Command) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Command

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Command

Source§

impl TS for Command

Source§

const DOCS: Option<&'static str>

JSDoc comment to describe this type in TypeScript - when TS is derived, docs are automatically read from your doc comments or #[doc = ".."] attributes
Source§

type WithoutGenerics = Command

If this type does not have generic parameters, then 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 more
Source§

fn ident() -> String

Identifier of this type, excluding generic parameters.
Source§

fn name() -> String

Name of this type in TypeScript, including generic parameters
Source§

fn decl_concrete() -> String

Declaration of this type using the supplied generic arguments. The resulting TypeScript definition will not be generic. For that, see TS::decl(). If this type is not generic, then this function is equivalent to TS::decl().
Source§

fn decl() -> String

Declaration of this type, e.g. type User = { user_id: number, ... }. This function will panic if the type has no declaration. Read more
Source§

fn inline() -> String

Formats this types definition in TypeScript, e.g { user_id: number }. This function will panic if the type cannot be inlined.
Source§

fn inline_flattened() -> String

Flatten a type declaration.
This function will panic if the type cannot be flattened.
Source§

fn visit_generics(v: &mut impl TypeVisitor)
where Self: 'static,

Iterates over all type parameters of this type.
Source§

fn output_path() -> Option<&'static Path>

Returns the output path to where T should be exported.
The returned path does not include the base directory from TS_RS_EXPORT_DIR. Read more
Source§

fn visit_dependencies(v: &mut impl TypeVisitor)
where Self: 'static,

Iterates over all dependency of this type.
§

fn dependencies() -> Vec<Dependency>
where Self: 'static,

Resolves all dependencies of this type recursively.
§

fn export() -> Result<(), ExportError>
where Self: 'static,

Manually export this type to the filesystem. To export this type together with all of its dependencies, use [TS::export_all]. Read more
§

fn export_all() -> Result<(), ExportError>
where Self: 'static,

Manually export this type to the filesystem, together with all of its dependencies.
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,

Manually export this type into the given directory, together with all of its dependencies.
To export only this type, without its dependencies, use [TS::export]. Read more
§

fn export_to_string() -> Result<String, ExportError>
where Self: 'static,

Manually generate bindings for this type, returning a String.
This function does not format the output, even if the format feature is enabled. Read more
§

fn default_output_path() -> Option<PathBuf>

Returns the output path to where T should be exported. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.