#[repr(i32)]pub enum InstructionKind {
Plugin = 0,
GetMetadata = 1,
Install = 2,
Initialize = 3,
Shutdown = 4,
ChatMessage = 5,
ChatCommand = 6,
ScheduledJob = 7,
}Expand description
[Internal] Kinds of instructions that can be sent to hank plugins.
Variants§
Plugin = 0
Plugin entry point.
GetMetadata = 1
Get the plugins metadata.
Install = 2
Call the plugins install function. (only happens once)
Initialize = 3
Call the plugins initialize function. (happens on every load)
Shutdown = 4
Call the plugins shutdown function. (happens on reload, unload, uninstall)
ChatMessage = 5
Call the plguins chat message handler.
ChatCommand = 6
Call the plguins chat command handler.
ScheduledJob = 7
Call the plguins scheduled job handler.
Implementations§
source§impl InstructionKind
impl InstructionKind
sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
source§impl Clone for InstructionKind
impl Clone for InstructionKind
source§fn clone(&self) -> InstructionKind
fn clone(&self) -> InstructionKind
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for InstructionKind
impl Debug for InstructionKind
source§impl Default for InstructionKind
impl Default for InstructionKind
source§fn default() -> InstructionKind
fn default() -> InstructionKind
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for InstructionKind
impl<'de> Deserialize<'de> for InstructionKind
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<InstructionKind> for i32
impl From<InstructionKind> for i32
source§fn from(value: InstructionKind) -> i32
fn from(value: InstructionKind) -> i32
Converts to this type from the input type.
source§impl Hash for InstructionKind
impl Hash for InstructionKind
source§impl Ord for InstructionKind
impl Ord for InstructionKind
source§fn cmp(&self, other: &InstructionKind) -> Ordering
fn cmp(&self, other: &InstructionKind) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for InstructionKind
impl PartialEq for InstructionKind
source§impl PartialOrd for InstructionKind
impl PartialOrd for InstructionKind
source§impl Serialize for InstructionKind
impl Serialize for InstructionKind
source§impl TryFrom<i32> for InstructionKind
impl TryFrom<i32> for InstructionKind
source§type Error = UnknownEnumValue
type Error = UnknownEnumValue
The type returned in the event of a conversion error.
source§fn try_from(value: i32) -> Result<InstructionKind, UnknownEnumValue>
fn try_from(value: i32) -> Result<InstructionKind, UnknownEnumValue>
Performs the conversion.
impl Copy for InstructionKind
impl Eq for InstructionKind
impl StructuralPartialEq for InstructionKind
Auto Trait Implementations§
impl Freeze for InstructionKind
impl RefUnwindSafe for InstructionKind
impl Send for InstructionKind
impl Sync for InstructionKind
impl Unpin for InstructionKind
impl UnwindSafe for InstructionKind
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)