pub struct ExecutionTask {
pub id: String,
pub task_type: TaskType,
pub task_fn: Box<dyn Fn() -> Result<()> + Send + Sync>,
pub metadata: TaskMetadata,
pub requirements: TaskRequirements,
pub constraints: TaskConstraints,
}Expand description
Core execution task definition
Represents a single unit of work that can be executed by the composable execution engine with configurable requirements and constraints.
Fields§
§id: StringUnique task identifier
task_type: TaskTypeTask type classification
task_fn: Box<dyn Fn() -> Result<()> + Send + Sync>Task function to execute (boxed closure)
metadata: TaskMetadataTask metadata and configuration
requirements: TaskRequirementsResource requirements for execution
constraints: TaskConstraintsExecution constraints and limits
Implementations§
Source§impl ExecutionTask
impl ExecutionTask
Sourcepub fn new<F>(id: String, name: String, task_fn: F) -> Self
pub fn new<F>(id: String, name: String, task_fn: F) -> Self
Create a new execution task with minimal configuration
Sourcepub fn with_config<F>(
id: String,
task_type: TaskType,
task_fn: F,
metadata: TaskMetadata,
requirements: TaskRequirements,
constraints: TaskConstraints,
) -> Self
pub fn with_config<F>( id: String, task_type: TaskType, task_fn: F, metadata: TaskMetadata, requirements: TaskRequirements, constraints: TaskConstraints, ) -> Self
Create a new execution task with full configuration
Sourcepub fn estimated_duration(&self) -> Duration
pub fn estimated_duration(&self) -> Duration
Get estimated execution time
Sourcepub fn has_dependencies(&self) -> bool
pub fn has_dependencies(&self) -> bool
Check if task has dependencies
Sourcepub fn priority(&self) -> TaskPriority
pub fn priority(&self) -> TaskPriority
Get task priority
Sourcepub fn requires_gpu(&self) -> bool
pub fn requires_gpu(&self) -> bool
Check if task requires GPU
Sourcepub fn is_cpu_intensive(&self) -> bool
pub fn is_cpu_intensive(&self) -> bool
Check if task is CPU intensive
Sourcepub fn is_memory_intensive(&self) -> bool
pub fn is_memory_intensive(&self) -> bool
Check if task is memory intensive
Sourcepub fn is_io_intensive(&self) -> bool
pub fn is_io_intensive(&self) -> bool
Check if task is I/O intensive
Sourcepub fn is_network_intensive(&self) -> bool
pub fn is_network_intensive(&self) -> bool
Check if task is network intensive
Trait Implementations§
Source§impl Clone for ExecutionTask
impl Clone for ExecutionTask
Auto Trait Implementations§
impl Freeze for ExecutionTask
impl !RefUnwindSafe for ExecutionTask
impl Send for ExecutionTask
impl Sync for ExecutionTask
impl Unpin for ExecutionTask
impl !UnwindSafe for ExecutionTask
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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