pub struct Metadata {Show 17 fields
pub name: String,
pub description: String,
pub version: String,
pub database: bool,
pub access_checks: Option<AccessCheckChain>,
pub escalation_key: Option<String>,
pub escalated_privileges: Vec<i32>,
pub author: String,
pub handles_commands: bool,
pub handles_messages: bool,
pub command_name: Option<String>,
pub aliases: Vec<String>,
pub arguments: Vec<Argument>,
pub subcommands: Vec<Command>,
pub allowed_hosts: Vec<String>,
pub pool_size: Option<i32>,
pub arg_required_else_help: bool,
}Expand description
Metadata for a plugin.
Fields§
§name: StringThe plguins name.
description: StringA short description of the plugin.
version: StringA version string for the plugin. Should follow semver.
@see: https://semver.org/
database: boolWhen true, a SQLite3 database will be created for the plugin. @deprecated All plugins get a database by default now.
access_checks: Option<AccessCheckChain>Access checks
All functionality of this plugin can optionally be gated by accses checks.
escalation_key: Option<String>A secret escalation key that grants this plugin specific escalated privileges.
escalated_privileges: Vec<i32>A list of escalated privileges that this plugin requests to use.
The author of the plugin.
handles_commands: boolWhether or not this plugin handles commands.
handles_messages: boolWhether or not this plugin handles messages.
command_name: Option<String>Optionally override the plugin command name.
aliases: Vec<String>Optional aliases for the plugin command.
arguments: Vec<Argument>Arguments for the plugin command.
subcommands: Vec<Command>Plugin subcommands.
allowed_hosts: Vec<String>Hosts that this plugin requests permissions to access via HTTP.
pool_size: Option<i32>Pool size this plugin requests.
arg_required_else_help: boolShow help if no args are passed to the plugin command.
NOTE: Subcommands count as arguments.
Implementations§
Source§impl Metadata
impl Metadata
Sourcepub fn escalation_key(&self) -> &str
pub fn escalation_key(&self) -> &str
Returns the value of escalation_key, or the default value if escalation_key is unset.
Sourcepub fn escalated_privileges(
&self,
) -> FilterMap<Cloned<Iter<'_, i32>>, fn(i32) -> Option<EscalatedPrivilege>> ⓘ
pub fn escalated_privileges( &self, ) -> FilterMap<Cloned<Iter<'_, i32>>, fn(i32) -> Option<EscalatedPrivilege>> ⓘ
Returns an iterator which yields the valid enum values contained in escalated_privileges.
Sourcepub fn push_escalated_privileges(&mut self, value: EscalatedPrivilege)
pub fn push_escalated_privileges(&mut self, value: EscalatedPrivilege)
Appends the provided enum value to escalated_privileges.
Sourcepub fn command_name(&self) -> &str
pub fn command_name(&self) -> &str
Returns the value of command_name, or the default value if command_name is unset.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Metadata
impl<'de> Deserialize<'de> for Metadata
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>,
Source§impl Message for Metadata
impl Message for Metadata
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.