Skip to main content

RunTask

Struct RunTask 

Source
pub struct RunTask<TTransformed, F, N> {
    pub function: F,
    pub next_step: N,
    pub message_carried_over: Option<Message<TTransformed>>,
    pub commit_request_carried_over: Option<CommitRequest>,
}

Fields§

§function: F§next_step: N§message_carried_over: Option<Message<TTransformed>>§commit_request_carried_over: Option<CommitRequest>

Implementations§

Source§

impl<TTransformed, F, N> RunTask<TTransformed, F, N>

Source

pub fn new(function: F, next_step: N) -> Self

Trait Implementations§

Source§

impl<TPayload, TTransformed, F, N> ProcessingStrategy<TPayload> for RunTask<TTransformed, F, N>
where TTransformed: Send + Sync, F: FnMut(Message<TPayload>) -> Result<Message<TTransformed>, SubmitError<TPayload>> + Send + Sync + 'static, N: ProcessingStrategy<TTransformed> + 'static,

Source§

fn poll(&mut self) -> Result<Option<CommitRequest>, StrategyError>

Poll the processor to check on the status of asynchronous tasks or perform other scheduled work. Read more
Source§

fn submit( &mut self, message: Message<TPayload>, ) -> Result<(), SubmitError<TPayload>>

Submit a message for processing. Read more
Source§

fn terminate(&mut self)

Close the processing strategy immediately, abandoning any work in progress. No more messages should be accepted by the instance after this method has been called.
Source§

fn join( &mut self, timeout: Option<Duration>, ) -> Result<Option<CommitRequest>, StrategyError>

Block until the processing strategy has completed all previously submitted work, or the provided timeout has been reached. This method should be called after close to provide a graceful shutdown. Read more

Auto Trait Implementations§

§

impl<TTransformed, F, N> Freeze for RunTask<TTransformed, F, N>
where F: Freeze, N: Freeze, TTransformed: Freeze,

§

impl<TTransformed, F, N> RefUnwindSafe for RunTask<TTransformed, F, N>
where F: RefUnwindSafe, N: RefUnwindSafe, TTransformed: RefUnwindSafe,

§

impl<TTransformed, F, N> Send for RunTask<TTransformed, F, N>
where F: Send, N: Send, TTransformed: Send,

§

impl<TTransformed, F, N> Sync for RunTask<TTransformed, F, N>
where F: Sync, N: Sync, TTransformed: Sync,

§

impl<TTransformed, F, N> Unpin for RunTask<TTransformed, F, N>
where F: Unpin, N: Unpin, TTransformed: Unpin,

§

impl<TTransformed, F, N> UnsafeUnpin for RunTask<TTransformed, F, N>
where F: UnsafeUnpin, N: UnsafeUnpin, TTransformed: UnsafeUnpin,

§

impl<TTransformed, F, N> UnwindSafe for RunTask<TTransformed, F, N>
where F: UnwindSafe, N: UnwindSafe, TTransformed: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more