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<'_>
impl TablesInput<'_>
Sourcepub fn list_tables(&self) -> &[ss_plugin_table_info]
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.
Sourcepub fn get_table<T, K>(&self, name: &CStr) -> Result<T, Error>where
T: TableAccess<Key = K>,
K: Key,
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
Sourcepub fn add_table<K, E>(
&self,
table: Table<K, E>,
) -> Result<Box<Table<K, E>>, Error>
pub fn add_table<K, E>( &self, table: Table<K, E>, ) -> Result<Box<Table<K, E>>, Error>
§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§
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> 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