pub struct Metadata {Show 16 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>,
}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.
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.impl StructuralPartialEq for Metadata
Auto Trait Implementations§
impl Freeze for Metadata
impl RefUnwindSafe for Metadata
impl Send for Metadata
impl Sync for Metadata
impl Unpin for Metadata
impl UnwindSafe for Metadata
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
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)
clone_to_uninit)