Struct dyer::PipeLineBuilder
source · [−]pub struct PipeLineBuilder<'pl, E, C> where
C: 'static, { /* private fields */ }
Expand description
Implementations
sourceimpl<'pl, E, C> PipeLineBuilder<'pl, E, C>
impl<'pl, E, C> PipeLineBuilder<'pl, E, C>
sourcepub fn new() -> Self
pub fn new() -> Self
Create an instance of PipeLine
Examples
let pipeline = PipeLineBuilder::new();
assert!(pipeline.entity_ref().is_none());
sourcepub fn build<T: Into<String>>(self, marker: T) -> PipeLine<'pl, E, C>
pub fn build<T: Into<String>>(self, marker: T) -> PipeLine<'pl, E, C>
Consume it and return an instance of PipeLine
Examples
async fn process_entity(_: &mut Vec<E>, _: &mut App<E>) {}
let pipeline = PipeLineBuilder::new();
.entity(process_entity)
.build("marker");
sourcepub fn extensions<S>(self, extensions: S) -> Self where
S: Any + Send + Sync + 'static,
pub fn extensions<S>(self, extensions: S) -> Self where
S: Any + Send + Sync + 'static,
set the extensions of PipeLineBuilder
Examples
let pipeline = Pipeline::builder()
.extensions(1i32)
.build("marker");
assert_eq!(pipeline.extensions().get::<i32>(), 1);
sourcepub fn extensions_ref(&self) -> &Extensions
pub fn extensions_ref(&self) -> &Extensions
get extensions of PipeLineBuilder
Examples
let pipeline = Pipeline::builder()
.extensions(1i32)
.build("marker");
assert_eq!(pipeline.extensions_ref().get::<i32>(), 1);
sourcepub fn rank(self, rank: i16) -> Self
pub fn rank(self, rank: i16) -> Self
set the rank of PipeLineBuilder
Examples
let pipeline = Pipeline::builder()
.rank(1)
.build("marker");
assert_eq!(pipeline.rank(), 1);
sourcepub fn rank_ref(&self) -> i16
pub fn rank_ref(&self) -> i16
get rank of PipeLineBuilder
Examples
async fn process_entity(&mut Vec<E>, &mut App<E>) {}
let pipeline = Pipeline::builder()
.rank(1)
.build("marker");
assert_eq!(pipeline.rank_ref(), 1);
sourcepub fn initializer(
self,
initials: &'pl dyn for<'a> Fn(&'a mut App<E>) -> BoxFuture<'a, Option<C>>
) -> Self
pub fn initializer(
self,
initials: &'pl dyn for<'a> Fn(&'a mut App<E>) -> BoxFuture<'a, Option<C>>
) -> Self
Set the initializer
of PipeLine
, if not called, the default value is None
Examples
async fn initializer(_: &mut App<E>) {}
let pipeline = PipeLines::builder()
.initializer(&initializer)
.build("marker".into());
assert! (pipeline.initializer.is_some())
sourcepub fn initializer_ref(
&self
) -> Option<&'pl dyn for<'a> Fn(&'a mut App<E>) -> BoxFuture<'a, Option<C>>>
pub fn initializer_ref(
&self
) -> Option<&'pl dyn for<'a> Fn(&'a mut App<E>) -> BoxFuture<'a, Option<C>>>
Get the shared reference of initializer
of PipeLine
, if not set before, None
is returned
Examples
async fn initializer(_: &mut App<E>) {}
let pipeline = PipeLines::builder()
.initializer(&initializer)
.build("marker".into());
assert_eq! (pipeline.initializer_ref (), Some(initializer))
sourcepub fn disposer(
self,
dispose: &'pl dyn for<'a> Fn(&'a mut App<E>) -> BoxFuture<'a, ()>
) -> Self
pub fn disposer(
self,
dispose: &'pl dyn for<'a> Fn(&'a mut App<E>) -> BoxFuture<'a, ()>
) -> Self
Set the disposer
of PipeLine
, if not called, the default value is None
Examples
async fn disposer(_: &mut App<E>) {}
let pipeline = PipeLines::builder()
.disposer(&disposer)
.build("marker".into());
assert! (pipeline.disposer.is_some())
sourcepub fn disposer_ref(
&self
) -> Option<&'pl dyn for<'a> Fn(&'a mut App<E>) -> BoxFuture<'a, ()>>
pub fn disposer_ref(
&self
) -> Option<&'pl dyn for<'a> Fn(&'a mut App<E>) -> BoxFuture<'a, ()>>
Get the shared reference of disposer
of PipeLine
, if not set before, None
is returned
Examples
async fn disposer(_: &mut App<E>) {}
let pipeline = PipeLines::builder()
.disposer(&disposer)
.build("marker".into());
assert_eq! (pipeline.disposer_ref (), Some(disposer))
sourcepub fn entity(
self,
entity: &'pl dyn for<'a> Fn(Vec<E>, &'a mut App<E>) -> BoxFuture<'a, ()>
) -> Self
pub fn entity(
self,
entity: &'pl dyn for<'a> Fn(Vec<E>, &'a mut App<E>) -> BoxFuture<'a, ()>
) -> Self
Set the process_entity
of PipeLine
, if not called, the default value is None
Examples
async fn process_entity(_ : & mut Vec < E >,_: &mut App<E>) {}
let pipeline = PipeLines::builder()
.entity(&process_entity)
.build("marker".into());
assert! (pipeline.process_entity.is_some())
sourcepub fn entity_ref(
&self
) -> Option<&'pl dyn for<'a> Fn(Vec<E>, &'a mut App<E>) -> BoxFuture<'a, ()>>
pub fn entity_ref(
&self
) -> Option<&'pl dyn for<'a> Fn(Vec<E>, &'a mut App<E>) -> BoxFuture<'a, ()>>
Get the shared reference of process_entity
of PipeLine
, if not set before, None
is returned
Examples
async fn process_entity(_ : & mut Vec < E >,_: &mut App<E>) {}
let pipeline = PipeLines::builder()
.entity(&process_entity)
.build("marker".into());
assert_eq! (pipeline.entity_ref (), Some(process_entity))
sourcepub fn yerr(
self,
yerr: &'pl dyn for<'a> Fn(Vec<Result<Response, MetaResponse>>, &'a mut App<E>) -> BoxFuture<'a, ()>
) -> Self
pub fn yerr(
self,
yerr: &'pl dyn for<'a> Fn(Vec<Result<Response, MetaResponse>>, &'a mut App<E>) -> BoxFuture<'a, ()>
) -> Self
Set the process_yerr
of PipeLine
, if not called, the default value is None
Examples
async fn process_yerr(_ : & mut Vec < Result<Response, MetaResponse> >,_: &mut App<E>) {}
let pipeline = PipeLines::builder()
.yerr(&process_yerr)
.build("marker".into());
assert! (pipeline.process_yerr.is_some())
sourcepub fn yerr_ref(
&self
) -> Option<&'pl dyn for<'a> Fn(Vec<Result<Response, MetaResponse>>, &'a mut App<E>) -> BoxFuture<'a, ()>>
pub fn yerr_ref(
&self
) -> Option<&'pl dyn for<'a> Fn(Vec<Result<Response, MetaResponse>>, &'a mut App<E>) -> BoxFuture<'a, ()>>
Get the shared reference of process_yerr
of PipeLine
, if not set before, None
is returned
Examples
async fn process_yerr(_ : & mut Vec < Result<Response, MetaResponse> >,_: &mut App<E>) {}
let pipeline = PipeLines::builder()
.yerr(&process_yerr)
.build("marker".into());
assert_eq! (pipeline.yerr_ref (), Some(process_yerr))
Auto Trait Implementations
impl<'pl, E, C> !RefUnwindSafe for PipeLineBuilder<'pl, E, C>
impl<'pl, E, C> !Send for PipeLineBuilder<'pl, E, C>
impl<'pl, E, C> !Sync for PipeLineBuilder<'pl, E, C>
impl<'pl, E, C> Unpin for PipeLineBuilder<'pl, E, C>
impl<'pl, E, C> !UnwindSafe for PipeLineBuilder<'pl, E, C>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more