pub struct Pipeline { /* private fields */ }Expand description
Ordered list of transformers run in registration order. Boxed + Send + Sync so a Pipeline can be shared across worker threads.
Implementations§
Source§impl Pipeline
impl Pipeline
pub fn new() -> Self
Sourcepub fn add<T: Transformer + Send + Sync + 'static>(self, t: T) -> Self
pub fn add<T: Transformer + Send + Sync + 'static>(self, t: T) -> Self
Append t to the run order. Returns self for builder chaining.
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Default pipeline. Equivalent to with_defaults_for(&PipelineConfig::default()).
Sourcepub fn with_defaults_for(cfg: &PipelineConfig) -> Self
pub fn with_defaults_for(cfg: &PipelineConfig) -> Self
Build the default pipeline tuned by cfg. Single uniform place where
every config-dependent and feature-gated transformer is wired up:
callers don’t sprinkle cfg!(feature = ...) of their own.
Sourcepub fn run(
&self,
doc: &mut Document,
meta: &SourceMeta,
engine: &mut DiagnosticEngine<Code>,
)
pub fn run( &self, doc: &mut Document, meta: &SourceMeta, engine: &mut DiagnosticEngine<Code>, )
Apply every registered transformer to doc in registration order.
Sourcepub fn run_silent(&self, doc: &mut Document)
pub fn run_silent(&self, doc: &mut Document)
Run with a synthesised Origin::Inline meta and a throwaway engine,
discarding diagnostics. For tests + tooling without a SourceMeta.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Pipeline
impl !RefUnwindSafe for Pipeline
impl Send for Pipeline
impl Sync for Pipeline
impl Unpin for Pipeline
impl UnsafeUnpin for Pipeline
impl !UnwindSafe for Pipeline
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