pub struct SimpleProcessorBuilder<T, S> {
pub transformer: T,
pub sink: S,
}
Fields§
§transformer: T
See Self::transformer
.
sink: S
See Self::sink
.
Implementations§
Source§impl SimpleProcessorBuilder<fn(String) -> Option<String>, ()>
impl SimpleProcessorBuilder<fn(String) -> Option<String>, ()>
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new SimpleProcessorBuilder
with the default transformer and no sink.
Source§impl<T, S> SimpleProcessorBuilder<T, S>
impl<T, S> SimpleProcessorBuilder<T, S>
Sourcepub fn transformer<N: FnMut(String) -> Option<String> + Send + 'static>(
self,
transformer: N,
) -> SimpleProcessorBuilder<N, S>
pub fn transformer<N: FnMut(String) -> Option<String> + Send + 'static>( self, transformer: N, ) -> SimpleProcessorBuilder<N, S>
Set the log line transformer.
If the transformer returns None
, the line will be ignored.
The default transformer will just return Some(line)
.
Sourcepub fn sink(self, sink: SinkHandle) -> SimpleProcessorBuilder<T, SinkHandle>
pub fn sink(self, sink: SinkHandle) -> SimpleProcessorBuilder<T, SinkHandle>
Set the sink to write to.
Source§impl<T: FnMut(String) -> Option<String> + Send + 'static> SimpleProcessorBuilder<T, SinkHandle>
impl<T: FnMut(String) -> Option<String> + Send + 'static> SimpleProcessorBuilder<T, SinkHandle>
Sourcepub fn build(self) -> SimpleProcessor<T>
pub fn build(self) -> SimpleProcessor<T>
Create a new SimpleProcessor
with the given sink
and Self::transformer
.
Trait Implementations§
Auto Trait Implementations§
impl<T, S> Freeze for SimpleProcessorBuilder<T, S>
impl<T, S> RefUnwindSafe for SimpleProcessorBuilder<T, S>where
T: RefUnwindSafe,
S: RefUnwindSafe,
impl<T, S> Send for SimpleProcessorBuilder<T, S>
impl<T, S> Sync for SimpleProcessorBuilder<T, S>
impl<T, S> Unpin for SimpleProcessorBuilder<T, S>
impl<T, S> UnwindSafe for SimpleProcessorBuilder<T, S>where
T: UnwindSafe,
S: 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