pub struct Mode(pub u8);Expand description
Mode defined by a line tag.
Tuple Fields§
§0: u8Implementations§
Source§impl Mode
impl Mode
Sourcepub const OPEN: Self
pub const OPEN: Self
Only MXP commands in the OPEN category are allowed. When a newline is received from the MUD, the mode reverts back to the default mode. This mode starts as the default mode.
Sourcepub const SECURE: Self
pub const SECURE: Self
All tags and commands in MXP are allowed within the line. When a newline is received from the MUD, the mode reverts back to the default mode.
Sourcepub const LOCKED: Self
pub const LOCKED: Self
No MXP or HTML commands are allowed in the line. The line is not parsed for any tags at all. When a newline is received from the MUD, the mode reverts back to the Default mode.
Sourcepub const RESET: Self
pub const RESET: Self
Close all open tags. Set active mode and default mode to OPEN.
Set text color and properties to default.
Sourcepub const SECURE_ONCE: Self
pub const SECURE_ONCE: Self
Set SECURE mode for the next tag only.
Must be immediately followed by a '<' character to start a tag.
Sourcepub const PERM_SECURE: Self
pub const PERM_SECURE: Self
Sourcepub const PERM_LOCKED: Self
pub const PERM_LOCKED: Self
Sourcepub const ROOM_EXITS: Self
pub const ROOM_EXITS: Self
The line is parsed as the name of a room.
Sourcepub const WELCOME_TEXT: Self
pub const WELCOME_TEXT: Self
This text is sent from the MUD at the beginning of a session to welcome the user to the MUD.
Sourcepub const USER_DEFINED_MIN: Self
pub const USER_DEFINED_MIN: Self
Minimum value of a user-defined line mode. See Mode::is_user_defined.
Sourcepub const USER_DEFINED_MAX: Self
pub const USER_DEFINED_MAX: Self
Maximum value of a user-defined line mode. See Mode::is_user_defined.
Source§impl Mode
impl Mode
Sourcepub const fn is_open(self) -> bool
pub const fn is_open(self) -> bool
When this mode is active, only MXP commands in the OPEN category are allowed.
The following modes are OPEN:
OPENPERM_OPEN- User defined line tags (see
is_user_defined)
Sourcepub const fn is_locked(self) -> bool
pub const fn is_locked(self) -> bool
When this mode is active, MXP tags should not be parsed.
The following modes are locked:
Sourcepub const fn is_automapping(self) -> bool
pub const fn is_automapping(self) -> bool
When this mode is active, the line is tagged for automappers.
Line modes between 10 ROOM_NAME and 19
WELCOME_TEXT are reserved for automappers.
Sourcepub const fn parse_as(self) -> Option<ParseAs>
pub const fn parse_as(self) -> Option<ParseAs>
How the line should be parsed by an automapper. This only applies to
ROOM_NAME, Mode::ROOM_DESC, and
ROOM_EXITS.
Sourcepub const fn is_user_defined(self) -> bool
pub const fn is_user_defined(self) -> bool
When this mode is active, the line is tagged for a MUD-specific purpose. The tag must have been previously defined using an MXP definition command to tell the client how to handle the line.
A common use for these is to tag various chat channels to allow client-side filtering or redirection of the text.
User-defined tags must be between 20 (USER_DEFINED_MIN) and
99 (USER_DEFINED_MAX).