pub struct PluginManager<T: PluginAware>(/* private fields */);
Expand description
Facilities applying plugins and determining which plugins have been applied to a plugin aware object.
Implementations§
Source§impl<T: PluginAware> PluginManager<T>
impl<T: PluginAware> PluginManager<T>
Sourcepub fn has_plugin(&self, id: &str) -> bool
pub fn has_plugin(&self, id: &str) -> bool
Check if this manager has a known plugin
pub fn has_plugin_ty<P: Plugin<T>>(&self) -> bool
Sourcepub fn apply<P: Plugin<T>>(&mut self, target: &mut T) -> ProjectResult
pub fn apply<P: Plugin<T>>(&mut self, target: &mut T) -> ProjectResult
Applies this plugin if it hasn’t been applied before
Sourcepub fn with_plugin<F>(
&mut self,
id: &str,
target: &mut T,
action: F,
) -> ProjectResult
pub fn with_plugin<F>( &mut self, id: &str, target: &mut T, action: F, ) -> ProjectResult
Set an action to perform if a plugin has been applied
Trait Implementations§
Source§impl<T: PluginAware> Clone for PluginManager<T>
impl<T: PluginAware> Clone for PluginManager<T>
Source§impl<T: PluginAware> Debug for PluginManager<T>
impl<T: PluginAware> Debug for PluginManager<T>
Source§impl<T: PluginAware> Default for PluginManager<T>
impl<T: PluginAware> Default for PluginManager<T>
Auto Trait Implementations§
impl<T> Freeze for PluginManager<T>
impl<T> !RefUnwindSafe for PluginManager<T>
impl<T> Send for PluginManager<T>
impl<T> Sync for PluginManager<T>
impl<T> Unpin for PluginManager<T>
impl<T> !UnwindSafe for PluginManager<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> InstanceOf for T
impl<T> InstanceOf for T
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