Skip to main content

HTTExtensionManager

Struct HTTExtensionManager 

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

Extension manager for coordinating multiple extensions.

Implementations§

Source§

impl HTTExtensionManager

Source

pub fn new() -> Self

Create a new extension manager.

Source

pub fn register_extension<E: HTTExtensionBase + 'static>( &mut self, extension: E, config: HashMap<String, String>, ) -> ExtensionResult<()>

Register an extension.

Source

pub fn get_extension(&self, name: &str) -> Option<&dyn HTTExtensionBase>

Get an extension by name.

Source

pub fn get_extension_mut( &mut self, name: &str, ) -> Option<&mut (dyn HTTExtensionBase + 'static)>

Get a mutable extension by name.

Source

pub fn get_extension_as<T: 'static>(&self, name: &str) -> Option<&T>

Get an extension as a specific type.

Source

pub fn get_extension_mut_as<T: 'static>(&mut self, name: &str) -> Option<&mut T>

Get a mutable extension as a specific type.

Source

pub fn extension_names(&self) -> Vec<String>

Get all registered extension names.

Source

pub fn extensions_with_capability( &self, capability: fn(&ExtensionCapabilities) -> bool, ) -> Vec<&dyn HTTExtensionBase>

Get all extensions with specific capabilities.

Source

pub fn initialize_all(&mut self) -> ExtensionResult<()>

Initialize all extensions in dependency order.

Source

pub fn shutdown_all(&mut self) -> ExtensionResult<()>

Shut down all extensions in reverse dependency order.

Source

pub fn get_config(&self, name: &str) -> Option<&HashMap<String, String>>

Get configuration for an extension.

Source

pub fn set_config( &mut self, name: &str, config: HashMap<String, String>, ) -> ExtensionResult<()>

Set configuration for an extension.

Source

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

Check if an extension is registered.

Source

pub fn remove_extension(&mut self, name: &str) -> ExtensionResult<()>

Remove an extension.

Trait Implementations§

Source§

impl Debug for HTTExtensionManager

Source§

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

Formats the value using the given formatter. 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, 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> 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 = !

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.