Loader

Struct Loader 

Source
pub struct Loader<'a, O: Send + Sync, I: Info> { /* private fields */ }
Expand description

Main loader for plugins and managers.

The Loader is the central component of Plux responsible for managing the entire plugin ecosystem. It handles plugin discovery, loading, unloading, and provides the interface for interacting with plugins and managers.

§Type Parameters

  • 'a - Lifetime parameter for references within the loader
  • O - Output type for plugin functions (must implement Send + Sync)
  • I - Plugin information type (must implement Info trait)

§Fields

  • managers - Collection of registered plugin managers
  • registry - Registry of functions available to plugins
  • requests - Collection of function requests from the host for plugins
  • plugins - Collection of loaded plugins

§Example

use plux_rs::prelude::*;
use plux_custom_manager::CustomManager;

let mut loader = Loader::new();
loader.context(|mut ctx| {
    ctx.register_manager(CustomManager::new())?;
    // Register functions and requests here
    Ok(())
});

Implementations§

Source§

impl<'a, O: Send + Sync, I: Info> Loader<'a, O, I>

Source

pub const fn new() -> Self

Creates a new plugin loader instance.

Initializes an empty loader with no managers, plugins, or functions registered.

§Returns

Returns a new Loader instance ready for configuration.

Source

pub fn context<FO, R>(&mut self, f: FO) -> R
where FO: FnOnce(LoaderContext<'a, '_, O, I>) -> R,

Provides access to the loader context for configuration.

This method creates a context that allows registering managers, functions, and requests with the loader. The context ensures proper initialization order and provides a fluent interface for loader setup.

§Parameters
  • f - Closure that receives the loader context and returns a result
§Returns

Returns the result of the closure execution.

§Example
use plux_rs::{Loader, StdInfo};

let mut loader = Loader::<'_, (), StdInfo>::new();
loader.context(|mut ctx| {
    // Register managers, functions, and requests here
    Ok::<(), Box<dyn std::error::Error>>(())
});
Source

pub fn stop(&mut self) -> Result<(), StopLoaderError>

Stops the loader and cleans up all resources.

This method unloads all plugins and unregisters all managers in the correct order, ensuring proper cleanup of resources.

§Returns

Returns Result<(), StopLoaderError> indicating success or failure of the shutdown process.

Source

pub fn register_manager<M>( &mut self, manager: M, ) -> Result<(), RegisterManagerError>
where M: Manager<'a, O, I> + 'static,

Registers a plugin manager with the loader.

This method registers a manager that can handle plugins of a specific format. The manager will be used to load and manage plugins matching its format.

§Parameters
  • manager - The manager instance to register
§Returns

Returns Result<(), RegisterManagerError> indicating success or failure. Fails if a manager with the same format is already registered.

§Type Parameters
  • M - Type of the manager (must implement Manager trait)
Source

pub unsafe fn forced_register_manager( &mut self, manager: Box<dyn Manager<'a, O, I>>, ) -> Result<(), RegisterManagerError>

Forcefully registers a plugin manager, bypassing safety checks.

This unsafe method allows registering a manager without checking for format conflicts. Use with caution as it may lead to undefined behavior.

§Parameters
  • manager - The manager instance to register
§Returns

Returns Result<(), RegisterManagerError> indicating success or failure.

§Safety

This method is unsafe because it bypasses format conflict checks that prevent multiple managers from handling the same plugin format.

Source

pub fn register_managers<M>( &mut self, managers: M, ) -> Result<(), RegisterManagerError>
where M: IntoIterator<Item = Box<dyn Manager<'a, O, I>>>,

Registers multiple plugin managers with the loader.

This method registers a collection of managers in sequence. Stops at the first error encountered.

§Parameters
  • managers - Iterator of manager instances to register
§Returns

Returns Result<(), RegisterManagerError> indicating success or failure.

Source

pub fn par_register_managers<M>( &mut self, managers: M, ) -> Result<(), RegisterManagerError>
where M: IntoParallelIterator<Item = Box<dyn Manager<'a, O, I>>>,

Registers multiple plugin managers in parallel.

This method registers a collection of managers concurrently using parallel processing. More efficient for large numbers of managers.

§Parameters
  • managers - Parallel iterator of manager instances to register
§Returns

Returns Result<(), RegisterManagerError> indicating success or failure.

Source

pub fn unregister_manager( &mut self, format: &str, ) -> Result<(), UnregisterManagerError>

Unregisters a plugin manager from the loader.

This method removes a manager from the loader, first unloading any plugins associated with that manager.

§Parameters
  • format - The format of the manager to unregister
§Returns

Returns Result<(), UnregisterManagerError> indicating success or failure.

Source

pub unsafe fn forced_unregister_manager( &mut self, index: usize, ) -> Result<(), UnregisterManagerError>

Forcefully unregisters a plugin manager, bypassing safety checks.

This unsafe method allows unregistering a manager without checking if it exists. Use with caution as it may lead to undefined behavior.

§Parameters
  • index - Index of the manager to unregister
§Returns

Returns Result<(), UnregisterManagerError> indicating success or failure.

§Safety

This method is unsafe because it bypasses existence checks that prevent accessing invalid memory or indices.

Source

pub fn get_manager_ref( &self, format: &str, ) -> Option<&Box<dyn Manager<'a, O, I>>>

Gets an immutable reference to a manager by format.

Searches for a registered manager that handles the specified format.

§Parameters
  • format - The plugin format to search for (e.g., “lua”, “rs”)
§Returns

Returns Option<&Box<dyn Manager<'a, O, I>>> containing the manager if found.

Source

pub fn par_get_manager_ref( &self, format: &str, ) -> Option<&Box<dyn Manager<'a, O, I>>>

Gets an immutable reference to a manager by format (parallel version).

Searches for a registered manager that handles the specified format using parallel processing.

§Parameters
  • format - The plugin format to search for (e.g., “lua”, “rs”)
§Returns

Returns Option<&Box<dyn Manager<'a, O, I>>> containing the manager if found.

Source

pub fn get_manager_mut( &mut self, format: &str, ) -> Option<&mut Box<dyn Manager<'a, O, I>>>

Gets a mutable reference to a manager by format.

Searches for a registered manager that handles the specified format.

§Parameters
  • format - The plugin format to search for (e.g., “lua”, “rs”)
§Returns

Returns Option<&mut Box<dyn Manager<'a, O, I>>> containing the manager if found.

Source

pub fn par_get_manager_mut( &mut self, format: &str, ) -> Option<&mut Box<dyn Manager<'a, O, I>>>

Gets a mutable reference to a manager by format (parallel version).

Searches for a registered manager that handles the specified format using parallel processing.

§Parameters
  • format - The plugin format to search for (e.g., “lua”, “rs”)
§Returns

Returns Option<&mut Box<dyn Manager<'a, O, I>>> containing the manager if found.

Source

pub fn register_plugin( &mut self, path: &str, ) -> Result<Bundle, RegisterPluginError>

Registers a plugin with the loader.

This method registers a plugin from the specified path, using the appropriate manager based on the plugin’s format.

§Parameters
  • path - Path to the plugin file or directory
§Returns

Returns Result<Bundle, RegisterPluginError> containing the plugin bundle on success.

Source

pub unsafe fn forced_register_plugin( &mut self, manager: &mut Box<dyn Manager<'a, O, I>>, plugin_info: PluginInfo<I>, ) -> Result<Bundle, RegisterPluginError>

Forcefully registers a plugin, bypassing safety checks.

This unsafe method allows registering a plugin without checking for duplicates. Use with caution as it may lead to undefined behavior.

§Parameters
  • manager - Reference to the manager that will handle this plugin
  • plugin_info - Plugin information to register
§Returns

Returns Result<Bundle, RegisterPluginError> containing the plugin bundle on success.

§Safety

This method is unsafe because it bypasses duplicate checking that prevents multiple plugins with the same ID and version from being registered.

Source

pub fn register_plugins<'b, P>( &mut self, paths: P, ) -> Result<Vec<Bundle>, RegisterPluginError>
where P: IntoIterator<Item = &'b str>,

Registers multiple plugins with the loader.

This method registers multiple plugins from the specified paths in sequence.

§Parameters
  • paths - Iterator of paths to plugin files or directories
§Returns

Returns Result<Vec<Bundle>, RegisterPluginError> containing the plugin bundles on success.

§Type Parameters
  • 'b - Lifetime of the path references
  • P - Type of the iterator containing path references
Source

pub fn par_register_plugins<'b, P>( &mut self, paths: P, ) -> Result<Vec<Bundle>, RegisterPluginError>
where P: IntoParallelIterator<Item = &'b str>,

Registers multiple plugins with the loader in parallel.

This method registers multiple plugins from the specified paths concurrently.

§Parameters
  • paths - Parallel iterator of paths to plugin files or directories
§Returns

Returns Result<Vec<Bundle>, RegisterPluginError> containing the plugin bundles on success.

§Type Parameters
  • 'b - Lifetime of the path references
  • P - Type of the parallel iterator containing path references
Source

pub fn unregister_plugin( &mut self, id: &str, version: &Version, ) -> Result<(), UnregisterPluginError>

Unregisters a plugin from the loader.

This method removes a plugin from the loader by ID and version, first unloading it if necessary.

§Parameters
  • id - Plugin identifier
  • version - Plugin version
§Returns

Returns Result<(), UnregisterPluginError> indicating success or failure.

Source

pub fn unregister_plugin_by_bundle( &mut self, bundle: &Bundle, ) -> Result<(), UnregisterPluginError>

Unregisters a plugin from the loader by bundle.

This method removes a plugin from the loader by bundle information, first unloading it if necessary.

§Parameters
  • bundle - Plugin bundle information
§Returns

Returns Result<(), UnregisterPluginError> indicating success or failure.

Source

pub fn par_unregister_plugin_by_bundle( &mut self, bundle: &Bundle, ) -> Result<(), UnregisterPluginError>

Unregisters a plugin from the loader by bundle (parallel version).

This method removes a plugin from the loader by bundle information using parallel processing, first unloading it if necessary.

§Parameters
  • bundle - Plugin bundle information
§Returns

Returns Result<(), UnregisterPluginError> indicating success or failure.

Source

pub unsafe fn forced_unregister_plugin( &mut self, index: usize, ) -> Result<(), UnregisterPluginError>

Forcefully unregisters a plugin, bypassing safety checks.

This unsafe method allows unregistering a plugin without checking if it exists. Use with caution as it may lead to undefined behavior.

§Parameters
  • index - Index of the plugin to unregister
§Returns

Returns Result<(), UnregisterPluginError> indicating success or failure.

§Safety

This method is unsafe because it bypasses existence checks that prevent accessing invalid memory or indices.

Source

pub fn unload_plugin( &mut self, id: &str, version: &Version, ) -> Result<(), UnloadPluginError>

Unloads a plugin from the execution environment.

This method unloads a plugin by ID and version, making it unavailable for execution.

§Parameters
  • id - Plugin identifier
  • version - Plugin version
§Returns

Returns Result<(), UnloadPluginError> indicating success or failure.

Source

pub fn par_unload_plugin( &mut self, id: &str, version: &Version, ) -> Result<(), UnloadPluginError>

Unloads a plugin from the execution environment (parallel version).

This method unloads a plugin by ID and version using parallel processing.

§Parameters
  • id - Plugin identifier
  • version - Plugin version
§Returns

Returns Result<(), UnloadPluginError> indicating success or failure.

Source

pub fn unload_plugin_by_bundle( &mut self, bundle: &Bundle, ) -> Result<(), UnloadPluginError>

Unloads a plugin from the execution environment by bundle.

This method unloads a plugin by bundle information, making it unavailable for execution.

§Parameters
  • bundle - Plugin bundle information
§Returns

Returns Result<(), UnloadPluginError> indicating success or failure.

Source

pub fn par_unload_plugin_by_bundle( &mut self, bundle: &Bundle, ) -> Result<(), UnloadPluginError>

Unloads a plugin from the execution environment by bundle (parallel version).

This method unloads a plugin by bundle information using parallel processing.

§Parameters
  • bundle - Plugin bundle information
§Returns

Returns Result<(), UnloadPluginError> indicating success or failure.

Source

pub unsafe fn forced_unload_plugin( &mut self, index: usize, ) -> Result<(), UnloadPluginError>

Forcefully unloads a plugin, bypassing safety checks.

This unsafe method allows unloading a plugin without checking if it exists. Use with caution as it may lead to undefined behavior.

§Parameters
  • index - Index of the plugin to unload
§Returns

Returns Result<(), UnloadPluginError> indicating success or failure.

§Safety

This method is unsafe because it bypasses existence checks that prevent accessing invalid memory or indices.

Source

pub fn get_plugin( &self, id: &str, version: &Version, ) -> Option<&Plugin<'a, O, I>>

Gets an immutable reference to a plugin by ID and version.

Searches for a registered plugin matching the specified ID and version.

§Parameters
  • id - Plugin identifier
  • version - Plugin version
§Returns

Returns Option<&Plugin<'a, O, I>> containing the plugin if found.

Source

pub fn par_get_plugin( &self, id: &str, version: &Version, ) -> Option<&Plugin<'a, O, I>>

Gets an immutable reference to a plugin by ID and version (parallel version).

Searches for a registered plugin matching the specified ID and version using parallel processing.

§Parameters
  • id - Plugin identifier
  • version - Plugin version
§Returns

Returns Option<&Plugin<'a, O, I>> containing the plugin if found.

Source

pub fn get_plugin_by_bundle(&self, bundle: &Bundle) -> Option<&Plugin<'a, O, I>>

Gets an immutable reference to a plugin by bundle.

Searches for a registered plugin matching the specified bundle.

§Parameters
  • bundle - Plugin bundle containing ID, version, and format
§Returns

Returns Option<&Plugin<'a, O, I>> containing the plugin if found.

Source

pub fn par_get_plugin_by_bundle( &self, bundle: &Bundle, ) -> Option<&Plugin<'a, O, I>>

Gets an immutable reference to a plugin by bundle (parallel version).

Searches for a registered plugin matching the specified bundle using parallel processing.

§Parameters
  • bundle - Plugin bundle containing ID, version, and format
§Returns

Returns Option<&Plugin<'a, O, I>> containing the plugin if found.

Source

pub fn get_plugin_mut( &mut self, id: &str, version: &Version, ) -> Option<&mut Plugin<'a, O, I>>

Gets a mutable reference to a plugin by ID and version.

This method searches for a registered plugin matching the specified ID and version.

§Parameters
  • id - Plugin identifier
  • version - Plugin version
§Returns

Returns Option<&mut Plugin<'a, O, I>> containing the plugin if found.

Source

pub fn par_get_plugin_mut( &mut self, id: &str, version: &Version, ) -> Option<&mut Plugin<'a, O, I>>

Gets a mutable reference to a plugin by ID and version (parallel version).

This method searches for a registered plugin matching the specified ID and version using parallel processing.

§Parameters
  • id - Plugin identifier
  • version - Plugin version
§Returns

Returns Option<&mut Plugin<'a, O, I>> containing the plugin if found.

Source

pub fn get_plugin_mut_by_bundle( &mut self, bundle: &Bundle, ) -> Option<&mut Plugin<'a, O, I>>

Gets a mutable reference to a plugin by bundle.

This method searches for a registered plugin matching the specified bundle.

§Parameters
  • bundle - Plugin bundle containing ID, version, and format
§Returns

Returns Option<&mut Plugin<'a, O, I>> containing the plugin if found.

Source

pub fn par_get_plugin_mut_by_bundle( &mut self, bundle: &Bundle, ) -> Option<&mut Plugin<'a, O, I>>

Gets a mutable reference to a plugin by bundle (parallel version).

This method searches for a registered plugin matching the specified bundle using parallel processing.

§Parameters
  • bundle - Plugin bundle containing ID, version, and format
§Returns

Returns Option<&mut Plugin<'a, O, I>> containing the plugin if found.

Source

pub fn get_plugins_by_id(&self, id: &str) -> Vec<&Plugin<'a, O, I>>

Gets all plugins with the specified ID.

Returns all versions of plugins matching the given ID.

§Parameters
  • id - Plugin identifier to search for
§Returns

Returns Vec<&Plugin<'a, O, I>> containing all matching plugins.

Source

pub fn par_get_plugins_by_id(&self, id: &str) -> Vec<&Plugin<'a, O, I>>

Gets all plugins with the specified ID (parallel version).

Returns all versions of plugins matching the given ID using parallel processing.

§Parameters
  • id - Plugin identifier to search for
§Returns

Returns Vec<&Plugin<'a, O, I>> containing all matching plugins.

Source

pub fn get_plugins_by_id_mut(&mut self, id: &str) -> Vec<&mut Plugin<'a, O, I>>

Gets mutable references to all plugins with the specified ID.

Returns mutable references to all versions of plugins matching the given ID.

§Parameters
  • id - Plugin identifier to search for
§Returns

Returns Vec<&mut Plugin<'a, O, I>> containing all matching plugins.

Source

pub fn par_get_plugins_by_id_mut( &mut self, id: &str, ) -> Vec<&mut Plugin<'a, O, I>>

Gets mutable references to all plugins with the specified ID (parallel version).

Returns mutable references to all versions of plugins matching the given ID using parallel processing.

§Parameters
  • id - Plugin identifier to search for
§Returns

Returns Vec<&mut Plugin<'a, O, I>> containing all matching plugins.

Source

pub const fn get_plugins(&self) -> &Vec<Plugin<'a, O, I>>

Gets a reference to all loaded plugins.

Returns the complete list of plugins currently managed by the loader.

§Returns

Returns &Vec<Plugin<'a, O, I>> containing all loaded plugins.

Source

pub const fn get_registry(&self) -> &Registry<O>

Gets a reference to the function registry.

Returns the registry containing all functions available to plugins.

§Returns

Returns &Registry<O> containing the function registry.

Source

pub const fn get_requests(&self) -> &Requests

Gets a reference to the function requests.

Returns a set of queries that plugins implement for the host.

§Returns

Returns &Requests containing the function requests.

Source

pub fn call_request( &self, name: &str, args: &[Variable], ) -> Result<Vec<O>, PluginCallRequestError>

Calls a function request across all eligible plugins.

This method calls the specified function request on all plugins that have the highest version for their ID (to avoid calling multiple versions of the same plugin).

§Parameters
  • name - Name of the function request to call
  • args - Arguments to pass to the function
§Returns

Returns Result<Vec<O>, PluginCallRequestError> containing results from all eligible plugins that have the requested function.

Source

pub fn par_call_request( &self, name: &str, args: &[Variable], ) -> Result<Vec<O>, PluginCallRequestError>

Calls a function request across all eligible plugins (parallel version).

This method calls the specified function request on all plugins that have the highest version for their ID (to avoid calling multiple versions of the same plugin) using parallel processing.

§Parameters
  • name - Name of the function request to call
  • args - Arguments to pass to the function
§Returns

Returns Result<Vec<O>, PluginCallRequestError> containing results from all eligible plugins that have the requested function.

Source§

impl<O: Send + Sync, I: Info> Loader<'static, O, I>

Source

pub fn load_plugin( &mut self, id: &str, version: &Version, ) -> Result<(), LoadPluginError>

Loads a plugin into the execution environment.

This method loads a plugin by ID and version, making it available for execution.

§Parameters
  • id - Plugin identifier
  • version - Plugin version
§Returns

Returns Result<(), LoadPluginError> indicating success or failure.

Source

pub fn par_load_plugin( &mut self, id: &str, version: &Version, ) -> Result<(), LoadPluginError>

Loads a plugin into the execution environment (parallel version).

This method loads a plugin by ID and version using parallel processing.

§Parameters
  • id - Plugin identifier
  • version - Plugin version
§Returns

Returns Result<(), LoadPluginError> indicating success or failure.

Source

pub fn load_plugin_by_bundle( &mut self, bundle: &Bundle, ) -> Result<(), LoadPluginError>

Loads a plugin into the execution environment by bundle.

This method loads a plugin by bundle information, making it available for execution.

§Parameters
  • bundle - Plugin bundle information
§Returns

Returns Result<(), LoadPluginError> indicating success or failure.

Source

pub fn par_load_plugin_by_bundle( &mut self, bundle: &Bundle, ) -> Result<(), LoadPluginError>

Loads a plugin into the execution environment by bundle (parallel version).

This method loads a plugin by bundle information using parallel processing.

§Parameters
  • bundle - Plugin bundle information
§Returns

Returns Result<(), LoadPluginError> indicating success or failure.

Source

pub unsafe fn forced_load_plugin( &mut self, index: usize, depends: Vec<(Bundle, bool)>, ) -> Result<(), LoadPluginError>

Forcefully loads a plugin, bypassing safety checks.

This unsafe method allows loading a plugin without checking if it exists. Use with caution as it may lead to undefined behavior.

§Parameters
  • index - Index of the plugin to load
  • depends - List of dependencies for this plugin
§Returns

Returns Result<(), LoadPluginError> indicating success or failure.

§Safety

This method is unsafe because it bypasses existence checks that prevent accessing invalid memory or indices.

Source

pub fn load_plugin_now( &mut self, path: &str, ) -> Result<Bundle, PluginOperationError>

Loads a plugin immediately from the specified path.

This convenience method registers and loads a plugin in a single operation. First registers the plugin, then loads it and all its dependencies.

§Parameters
  • path - Path to the plugin file or directory
§Returns

Returns Result<Bundle, PluginOperationError> containing the plugin bundle on success, or an error from registration or loading.

§Example
use plux_rs::{Loader, StdInfo};

let mut loader = Loader::<'_, (), StdInfo>::new();
// Configure loader with managers...

let bundle = match loader.load_plugin_now("my_plugin-v1.0.0.cst") {
    Ok(bundle) => bundle,
    Err(e) => return Err(e.into()),
};

println!("Loaded plugin: {}", bundle.id);
Source

pub fn load_plugins<'b, P>( &mut self, paths: P, ) -> Result<Vec<Bundle>, PluginOperationError>
where P: IntoIterator<Item = &'b str>,

Loads multiple plugins from the specified paths.

This method registers and loads multiple plugins in sequence.

§Parameters
  • paths - Iterator of paths to plugin files or directories
§Returns

Returns Result<Vec<Bundle>, PluginOperationError> containing the plugin bundles on success, or errors from registration or loading.

§Type Parameters
  • 'b - Lifetime of the path references
  • P - Type of the iterator containing path references
Source

pub fn par_load_plugins<'b, P>( &mut self, paths: P, ) -> Result<Vec<Bundle>, PluginOperationError>
where P: IntoParallelIterator<Item = &'b str>,

Loads multiple plugins from the specified paths (parallel version).

This method registers and loads multiple plugins concurrently using parallel processing.

§Parameters
  • paths - Parallel iterator of paths to plugin files or directories
§Returns

Returns Result<Vec<Bundle>, PluginOperationError> containing the plugin bundles on success, or errors from registration or loading.

§Type Parameters
  • 'b - Lifetime of the path references
  • P - Type of the parallel iterator containing path references
Source

pub fn load_only_used_plugins<'b, P>( &mut self, paths: P, ) -> Result<Vec<Bundle>, PluginOperationError>
where P: IntoIterator<Item = &'b str>,

Loads only the plugins that are used (not dependencies of other plugins).

This method registers and loads only the plugins that are not dependencies of other plugins, and automatically unregisters unused plugins.

§Parameters
  • paths - Iterator of paths to plugin files or directories
§Returns

Returns Result<Vec<Bundle>, PluginOperationError> containing the plugin bundles on success, or errors from registration, unregistration, or loading.

§Type Parameters
  • 'b - Lifetime of the path references
  • P - Type of the iterator containing path references
Source

pub fn par_load_only_used_plugins<'b, P>( &mut self, paths: P, ) -> Result<Vec<Bundle>, PluginOperationError>
where P: IntoParallelIterator<Item = &'b str>,

Loads only the plugins that are used (not dependencies of other plugins) (parallel version).

This method registers and loads only the plugins that are not dependencies of other plugins using parallel processing, and automatically unregisters unused plugins.

§Parameters
  • paths - Parallel iterator of paths to plugin files or directories
§Returns

Returns Result<Vec<Bundle>, PluginOperationError> containing the plugin bundles on success, or errors from registration, unregistration, or loading.

§Type Parameters
  • 'b - Lifetime of the path references
  • P - Type of the parallel iterator containing path references

Trait Implementations§

Source§

impl<O: Send + Sync, I: Info> Drop for Loader<'_, O, I>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'a, O, I> Freeze for Loader<'a, O, I>

§

impl<'a, O, I> !RefUnwindSafe for Loader<'a, O, I>

§

impl<'a, O, I> Send for Loader<'a, O, I>

§

impl<'a, O, I> Sync for Loader<'a, O, I>

§

impl<'a, O, I> Unpin for Loader<'a, O, I>
where I: Unpin,

§

impl<'a, O, I> !UnwindSafe for Loader<'a, O, I>

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

Source§

type Output = T

Should always be Self
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.