pub struct Callback<F> { /* private fields */ }Expand description
Callback middleware for custom processing.
Wraps a closure for simple one-off transformations.
Implementations§
Trait Implementations§
Source§impl<F> Middleware for Callback<F>
impl<F> Middleware for Callback<F>
Source§fn post_process(
&self,
ctx: &mut MiddlewareContext,
entities: Vec<Entity>,
) -> Result<Vec<Entity>>
fn post_process( &self, ctx: &mut MiddlewareContext, entities: Vec<Entity>, ) -> Result<Vec<Entity>>
Postprocess entities after extraction. Read more
Source§fn pre_process<'a>(
&self,
ctx: &mut MiddlewareContext,
text: &'a str,
) -> Result<Cow<'a, str>>
fn pre_process<'a>( &self, ctx: &mut MiddlewareContext, text: &'a str, ) -> Result<Cow<'a, str>>
Preprocess text before entity extraction. Read more
Auto Trait Implementations§
impl<F> Freeze for Callback<F>where
F: Freeze,
impl<F> RefUnwindSafe for Callback<F>where
F: RefUnwindSafe,
impl<F> Send for Callback<F>where
F: Send,
impl<F> Sync for Callback<F>where
F: Sync,
impl<F> Unpin for Callback<F>where
F: Unpin,
impl<F> UnsafeUnpin for Callback<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for Callback<F>where
F: UnwindSafe,
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