Skip to main content

Action

Type Alias Action 

Source
pub type Action = Decision;
Expand description

The answer to a decision hook: the contract’s decision variant, which is action plus DenyJson and MessageJson for rich text (since 0.1.2).

The SDK answers through the decisions export, which hosts from 0.1.2 call. An older host calls the handler hooks instead and shows the rich cases as their plain words.

Aliased Type§

pub enum Action {
    Continue,
    Deny(String),
    Server(String),
    Message(String),
    Queue(String),
    LeaveQueue,
    DenyJson(String),
    MessageJson(String),
}

Variants§

§

Continue

§

Deny(String)

§

Server(String)

§

Message(String)

§

Queue(String)

§

LeaveQueue

§

DenyJson(String)

§

MessageJson(String)

Implementations§

Source§

impl Action

Source

pub fn deny(reason: impl Into<String>) -> Self

deny(reason): plain text of 1..=1024 bytes.

Source

pub fn deny_json(reason: impl ToString) -> Self

deny-json(reason): a JSON text component of at most 32 KiB, given as a serde_json::Value or as JSON text.

Source

pub fn message(text: impl Into<String>) -> Self

message(text): reply to the player who ran a command.

Source

pub fn message_json(text: impl ToString) -> Self

message-json(text): reply with a JSON text component of at most 32 KiB, given as a serde_json::Value or as JSON text.

Source

pub fn server(name: impl Into<String>) -> Self

server(name): send the player to a backend.