Skip to main content

ModuleTable

Struct ModuleTable 

Source
pub struct ModuleTable { /* private fields */ }
Expand description

Module table (from module.c module hash table)

Implementations§

Source§

impl ModuleTable

Source

pub fn new() -> Self

Source

pub fn load_module(&mut self, name: &str) -> bool

Load a module (from module.c load_module)

Source

pub fn unload_module(&mut self, name: &str) -> bool

Unload a module (from module.c unload_module)

Source

pub fn is_loaded(&self, name: &str) -> bool

Check if module is loaded

Source

pub fn list_loaded(&self) -> Vec<&str>

List all loaded modules

Source

pub fn list_all(&self) -> Vec<(&str, &ModuleState)>

List all modules (including unloaded)

Source

pub fn addbuiltin(&mut self, name: &str, module: &str)

Register a builtin (from module.c addbuiltin)

Source

pub fn deletebuiltin(&mut self, name: &str, module: &str)

Unregister a builtin (from module.c deletebuiltin)

Source

pub fn add_autobin(&mut self, name: &str, module: &str)

Register autoloading builtin (from module.c add_autobin)

Source

pub fn del_autobin(&mut self, name: &str)

Remove autoloading builtin (from module.c del_autobin)

Source

pub fn setbuiltins(&mut self, module: &str, names: &[&str])

Set builtins en masse (from module.c setbuiltins/addbuiltins)

Source

pub fn addconddef(&mut self, name: &str, module: &str)

Register a condition (from module.c addconddef)

Source

pub fn deleteconddef(&mut self, name: &str, module: &str)

Unregister a condition (from module.c deleteconddef)

Source

pub fn getconddef(&self, name: &str) -> Option<&str>

Get condition definition (from module.c getconddef)

Source

pub fn add_autocond(&mut self, name: &str, module: &str)

Register autoloading condition (from module.c add_autocond)

Source

pub fn del_autocond(&mut self, name: &str)

Remove autoloading condition (from module.c del_autocond)

Source

pub fn addhookdef(&mut self, name: &str)

Register a hook (from module.c addhookdef)

Source

pub fn addhookdefs(&mut self, names: &[&str])

Register multiple hooks (from module.c addhookdefs)

Source

pub fn deletehookdef(&mut self, name: &str)

Unregister a hook (from module.c deletehookdef)

Source

pub fn deletehookdefs(&mut self, names: &[&str])

Unregister multiple hooks (from module.c deletehookdefs)

Source

pub fn addhookfunc(&mut self, hook: &str, func: &str)

Add function to hook (from module.c addhookdeffunc/addhookfunc)

Source

pub fn deletehookfunc(&mut self, hook: &str, func: &str)

Remove function from hook (from module.c deletehookdeffunc/deletehookfunc)

Source

pub fn gethookdef(&self, name: &str) -> Option<&Vec<String>>

Get hook definition (from module.c gethookdef)

Source

pub fn runhookdef(&self, name: &str) -> Vec<String>

Run hook functions (from module.c runhookdef)

Source

pub fn addparamdef(&mut self, name: &str, module: &str)

Register a parameter from module (from module.c addparamdef/checkaddparam)

Source

pub fn deleteparamdef(&mut self, name: &str, module: &str)

Unregister a parameter (from module.c deleteparamdef)

Source

pub fn setparamdefs(&mut self, module: &str, names: &[&str])

Set parameters en masse (from module.c setparamdefs)

Source

pub fn add_autoparam(&mut self, name: &str, module: &str)

Register autoloading parameter (from module.c add_autoparam)

Source

pub fn del_autoparam(&mut self, name: &str)

Remove autoloading parameter (from module.c del_autoparam)

Source

pub fn addwrapper(&mut self, name: &str, flags: u32, module: &str)

Add wrapper (from module.c addwrapper)

Source

pub fn deletewrapper(&mut self, module: &str, name: &str)

Remove wrapper (from module.c deletewrapper)

Source

pub fn enable_feature(&mut self, module: &str, name: &str) -> bool

Enable a feature (from module.c enables_)

Source

pub fn disable_feature(&mut self, module: &str, name: &str) -> bool

Disable a feature

Source

pub fn list_features(&self, module: &str) -> Vec<&ModuleFeature>

List features of a module (from module.c features_)

Source

pub fn module_linked(&self, name: &str) -> bool

Check if a module is linked (statically compiled) (from module.c module_linked)

Source

pub fn resolve_autoload_builtin(&self, name: &str) -> Option<&str>

Resolve autoload — find which module provides a builtin

Source

pub fn resolve_autoload_param(&self, name: &str) -> Option<&str>

Resolve autoload — find which module provides a parameter

Source

pub fn ensurefeature(&mut self, module: &str, feature: &str) -> bool

Ensure a module’s feature is available

Trait Implementations§

Source§

impl Debug for ModuleTable

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for ModuleTable

Source§

fn default() -> ModuleTable

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more