pub struct TamperRegistry { /* private fields */ }Expand description
Registry that holds all loaded external tampers.
Designed for concurrent read access: after construction it is
immutably shared across threads via Arc<TamperRegistry>.
Implementations§
Source§impl TamperRegistry
impl TamperRegistry
Sourcepub fn register(&mut self, plugin: Box<dyn Tamper>) -> Result<(), PluginError>
pub fn register(&mut self, plugin: Box<dyn Tamper>) -> Result<(), PluginError>
Register a tamper. Returns an error on name collision.
§Errors
Returns PluginError::NameCollision if a tamper with the same
name is already registered.
Sourcepub fn all(&self) -> &[Box<dyn Tamper>]
pub fn all(&self) -> &[Box<dyn Tamper>]
All registered tampers (order matches registration order).
Sourcepub fn load_dir(&mut self, dir: &Path) -> Vec<PluginError>
pub fn load_dir(&mut self, dir: &Path) -> Vec<PluginError>
Load all plugins from the given directory, in-place.
Files with unrecognised extensions are silently skipped. Load failures are collected and returned; the registry still contains all plugins that loaded successfully.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for TamperRegistry
impl !UnwindSafe for TamperRegistry
impl Freeze for TamperRegistry
impl Send for TamperRegistry
impl Sync for TamperRegistry
impl Unpin for TamperRegistry
impl UnsafeUnpin for TamperRegistry
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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