pub struct MiddlewareChain { /* private fields */ }Expand description
Middleware chain for executing multiple middleware components
Implementations§
Source§impl MiddlewareChain
impl MiddlewareChain
Sourcepub fn new(config: MiddlewareChainConfig) -> Self
pub fn new(config: MiddlewareChainConfig) -> Self
Create a new middleware chain
Sourcepub fn add_middleware(&mut self, middleware: Box<dyn PipelineMiddleware>)
pub fn add_middleware(&mut self, middleware: Box<dyn PipelineMiddleware>)
Add middleware to the chain
Sourcepub fn execute(
&mut self,
context: &mut MiddlewareContext,
input: &Array2<Float>,
processor: &dyn Fn(&Array2<Float>) -> SklResult<Array2<Float>>,
) -> SklResult<Array2<Float>>
pub fn execute( &mut self, context: &mut MiddlewareContext, input: &Array2<Float>, processor: &dyn Fn(&Array2<Float>) -> SklResult<Array2<Float>>, ) -> SklResult<Array2<Float>>
Execute the middleware chain
Sourcepub fn get_stats(&self) -> &MiddlewareStats
pub fn get_stats(&self) -> &MiddlewareStats
Get execution statistics
Auto Trait Implementations§
impl Freeze for MiddlewareChain
impl !RefUnwindSafe for MiddlewareChain
impl Send for MiddlewareChain
impl Sync for MiddlewareChain
impl Unpin for MiddlewareChain
impl !UnwindSafe for MiddlewareChain
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> 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