Struct TablesInput

Source
pub struct TablesInput<'t> { /* private fields */ }
Expand description

An object containing table-related vtables

It’s used as a token to prove you’re allowed to read/write tables or manage their fields

Implementations§

Source§

impl TablesInput<'_>

Source

pub fn list_tables(&self) -> &[ss_plugin_table_info]

§List the available tables

Note: this method is of limited utility in actual plugin code (you know the tables you want to access), so it returns the unmodified structure from the plugin API, including raw pointers to C-style strings. This may change later.

Source

pub fn get_table<T, K>(&self, name: &CStr) -> Result<T, Error>
where T: TableAccess<Key = K>, K: Key,

§Import a table from the Falco plugin API

The key type is verified by the plugin API, so this method will return an error on mismatch

Source

pub fn add_table<K, E>( &self, table: Table<K, E>, ) -> Result<Box<Table<K, E>>, Error>
where K: Key + Ord + Borrow<<K as Key>::Borrowed>, <K as Key>::Borrowed: Ord + ToOwned<Owned = K>, E: Entry, E::Metadata: TableMetadata,

§Export a table to the Falco plugin API

This method returns a Box, which you need to store in your plugin instance even if you don’t intend to use the table yourself (the table is destroyed when going out of scope, which will lead to crashes in plugins using your table).

Trait Implementations§

Source§

impl<'t> Debug for TablesInput<'t>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'t> Freeze for TablesInput<'t>

§

impl<'t> RefUnwindSafe for TablesInput<'t>

§

impl<'t> !Send for TablesInput<'t>

§

impl<'t> !Sync for TablesInput<'t>

§

impl<'t> Unpin for TablesInput<'t>

§

impl<'t> UnwindSafe for TablesInput<'t>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.