pub struct TaskParserEvent {
pub id: Uuid,
pub account_task: TaskEvent,
pub timestamp: u64,
pub metadata: Map<String, Value>,
pub context: ExecutionMark,
pub run_id: Uuid,
pub prefix_request: Uuid,
}Expand description
Parser task message model.
Used to create downstream tasks after parsing, or move to the next processing stage. Contains task identity, metadata, execution context, and predecessor request reference.
Fields§
§id: UuidUnique identifier.
account_task: TaskEventAssociated account task information.
timestamp: u64Timestamp.
metadata: Map<String, Value>Metadata (TaskParserEvent.meta => Task.metadata => Context.meta.task_meta => Module.generate).
context: ExecutionMarkExecution context (ExecutionMark).
run_id: UuidRun identifier (Run ID).
prefix_request: UuidPredecessor request identifier.
Implementations§
Source§impl TaskParserEvent
impl TaskParserEvent
Sourcepub fn with_context(self, ctx: ExecutionMark) -> Self
pub fn with_context(self, ctx: ExecutionMark) -> Self
Sets explicit execution context (ExecutionMark) for parser-chain execution.
Typical uses:
- Precisely control which step index target module starts from.
- Combine with
stay_current_stepto prevent auto-advancing.
Sourcepub fn stay_current_step(self) -> Self
pub fn stay_current_step(self) -> Self
Marks this task to stay on the current parser node and avoid auto-advance.
Behavior:
- When parser returns
ParserTaskModeland this is set, the chain loops on this step. - Otherwise, the loop is considered complete and processing continues.
pub fn get_context(&self) -> &ExecutionMark
pub fn with_meta<T>(self, meta: T) -> Selfwhere
T: Serialize,
pub fn add_meta<T>(self, key: impl AsRef<str>, value: T) -> Selfwhere
T: Serialize,
Sourcepub fn with_prefix_request(self, prefix: Uuid) -> Self
pub fn with_prefix_request(self, prefix: Uuid) -> Self
Overrides chain backtracking pointer (points to predecessor Request.id).
By default this pointer is inherited from Response.prefix_request.
For cross-module jumps, you can set it explicitly to change first-failure fallback target.
pub fn start_other_module( response: &Response, module_name: impl AsRef<str>, ) -> Self
Sourcepub fn start_other_module_with_ctx(
response: &Response,
module_name: impl AsRef<str>,
ctx: ExecutionMark,
) -> Self
pub fn start_other_module_with_ctx( response: &Response, module_name: impl AsRef<str>, ctx: ExecutionMark, ) -> Self
Creates ParserTaskModel for target module with explicit context.
Typical usage:
- Cross-jump to step 0: pass
ExecutionMark::default().with_step_idx(0). - Stay on current step during retry: pass
ExecutionMarkwithstay_current_step=true.
Trait Implementations§
Source§impl Clone for TaskParserEvent
impl Clone for TaskParserEvent
Source§fn clone(&self) -> TaskParserEvent
fn clone(&self) -> TaskParserEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TaskParserEvent
impl Debug for TaskParserEvent
Source§impl<'de> Deserialize<'de> for TaskParserEvent
impl<'de> Deserialize<'de> for TaskParserEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl EventProcessorTrait<TaskParserEvent, Task> for TaskModelProcessor
impl EventProcessorTrait<TaskParserEvent, Task> for TaskModelProcessor
fn pre_status(&self, input: &TaskParserEvent) -> Option<EventEnvelope>
fn finish_status( &self, input: &TaskParserEvent, output: &Task, ) -> Option<EventEnvelope>
fn working_status(&self, input: &TaskParserEvent) -> Option<EventEnvelope>
fn error_status( &self, input: &TaskParserEvent, err: &Error, ) -> Option<EventEnvelope>
fn retry_status( &self, input: &TaskParserEvent, retry_policy: &RetryPolicy, ) -> Option<EventEnvelope>
Source§impl From<&Response> for TaskParserEvent
impl From<&Response> for TaskParserEvent
Source§impl From<&TaskParserEvent> for ParserTaskModelEvent
impl From<&TaskParserEvent> for ParserTaskModelEvent
Source§fn from(value: &TaskParserEvent) -> Self
fn from(value: &TaskParserEvent) -> Self
Source§impl From<TaskParserEvent> for UnifiedTaskInput
impl From<TaskParserEvent> for UnifiedTaskInput
Source§fn from(value: TaskParserEvent) -> Self
fn from(value: TaskParserEvent) -> Self
Source§impl Identifiable for TaskParserEvent
impl Identifiable for TaskParserEvent
Source§impl Offloadable for TaskParserEvent
impl Offloadable for TaskParserEvent
fn should_offload(&self, _threshold: usize) -> bool
fn offload<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_storage: &'life1 Arc<dyn BlobStorage>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn reload<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_storage: &'life1 Arc<dyn BlobStorage>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl Prioritizable for TaskParserEvent
impl Prioritizable for TaskParserEvent
fn get_priority(&self) -> Priority
Source§impl ProcessorTrait<TaskParserEvent, Task> for TaskModelProcessor
impl ProcessorTrait<TaskParserEvent, Task> for TaskModelProcessor
Source§fn process<'life0, 'async_trait>(
&'life0 self,
input: TaskParserEvent,
context: ProcessorContext,
) -> Pin<Box<dyn Future<Output = ProcessorResult<Task>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn process<'life0, 'async_trait>(
&'life0 self,
input: TaskParserEvent,
context: ProcessorContext,
) -> Pin<Box<dyn Future<Output = ProcessorResult<Task>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn pre_process<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_input: &'life1 TaskParserEvent,
_context: &'life2 ProcessorContext,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn pre_process<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_input: &'life1 TaskParserEvent,
_context: &'life2 ProcessorContext,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn handle_error<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
input: &'life1 TaskParserEvent,
error: Error,
_context: &'life2 ProcessorContext,
) -> Pin<Box<dyn Future<Output = ProcessorResult<Task>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn handle_error<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
input: &'life1 TaskParserEvent,
error: Error,
_context: &'life2 ProcessorContext,
) -> Pin<Box<dyn Future<Output = ProcessorResult<Task>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn post_process<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_input: &'life1 Input,
_output: &'life2 Output,
_context: &'life3 ProcessorContext,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn post_process<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_input: &'life1 Input,
_output: &'life2 Output,
_context: &'life3 ProcessorContext,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Source§fn should_process<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_input: &'life1 Input,
_context: &'life2 ProcessorContext,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn should_process<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_input: &'life1 Input,
_context: &'life2 ProcessorContext,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Auto Trait Implementations§
impl Freeze for TaskParserEvent
impl RefUnwindSafe for TaskParserEvent
impl Send for TaskParserEvent
impl Sync for TaskParserEvent
impl Unpin for TaskParserEvent
impl UnsafeUnpin for TaskParserEvent
impl UnwindSafe for TaskParserEvent
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>
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>
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