Skip to main content

TaskDef

Struct TaskDef 

Source
pub struct TaskDef {
Show 24 fields pub name: String, pub description: Option<String>, pub retry_count: i32, pub retry_logic: RetryLogic, pub retry_delay_seconds: i32, pub backoff_scale_factor: i32, pub timeout_seconds: i64, pub response_timeout_seconds: i64, pub poll_timeout_seconds: i64, pub timeout_policy: TimeoutPolicy, pub concurrent_exec_limit: i32, pub rate_limit_per_frequency: i32, pub rate_limit_frequency_in_seconds: i32, pub owner_email: Option<String>, pub input_keys: Vec<String>, pub output_keys: Vec<String>, pub input_template: HashMap<String, Value>, pub created_by: Option<String>, pub create_time: Option<i64>, pub updated_by: Option<String>, pub update_time: Option<i64>, pub input_schema: Option<Value>, pub output_schema: Option<Value>, pub runtime_metadata: Vec<String>,
}
Expand description

Task definition describing a task type.

Fields§

§name: String

Task name (unique identifier).

§description: Option<String>

Task description.

§retry_count: i32

Number of retry attempts.

§retry_logic: RetryLogic

Retry logic.

§retry_delay_seconds: i32

Delay between retries in seconds.

§backoff_scale_factor: i32

Backoff scale factor for exponential backoff.

§timeout_seconds: i64

Timeout in seconds.

§response_timeout_seconds: i64

Response timeout in seconds.

§poll_timeout_seconds: i64

Poll timeout in seconds.

§timeout_policy: TimeoutPolicy

Timeout policy.

§concurrent_exec_limit: i32

Maximum concurrent executions (0 = unlimited).

§rate_limit_per_frequency: i32

Rate limit per frequency.

§rate_limit_frequency_in_seconds: i32

Rate limit frequency in seconds.

§owner_email: Option<String>

Owner email.

§input_keys: Vec<String>

Input keys (expected input parameters).

§output_keys: Vec<String>

Output keys (expected output parameters).

§input_template: HashMap<String, Value>

Input template (default input values).

§created_by: Option<String>

Created by.

§create_time: Option<i64>

Created time.

§updated_by: Option<String>

Updated by.

§update_time: Option<i64>

Update time.

§input_schema: Option<Value>

Input schema (JSON Schema for input validation).

§output_schema: Option<Value>

Output schema (JSON Schema for output validation).

§runtime_metadata: Vec<String>

Runtime metadata (e.g. declared credential names required to dispatch this task).

Implementations§

Source§

impl TaskDef

Source

pub fn new(name: impl Into<String>) -> Self

Create a new task definition with the given name.

Source

pub fn with_description(self, desc: impl Into<String>) -> Self

Set description.

Source

pub fn with_retry( self, count: i32, logic: RetryLogic, delay_seconds: i32, ) -> Self

Set retry configuration.

Source

pub fn with_timeout(self, timeout_seconds: i64, policy: TimeoutPolicy) -> Self

Set timeout configuration.

Note: This also sets response_timeout_seconds to the same value to ensure response_timeout_seconds <= timeout_seconds (required by Conductor validation).

Source

pub fn with_response_timeout(self, seconds: i64) -> Self

Set response timeout.

Source

pub fn with_rate_limit(self, limit: i32, frequency_seconds: i32) -> Self

Set rate limit.

Source

pub fn with_concurrent_limit(self, limit: i32) -> Self

Set concurrent execution limit.

Source

pub fn with_owner(self, email: impl Into<String>) -> Self

Set owner email.

Source

pub fn with_input_keys(self, keys: Vec<String>) -> Self

Set input keys.

Source

pub fn with_output_keys(self, keys: Vec<String>) -> Self

Set output keys.

Source

pub fn with_runtime_metadata(self, runtime_metadata: Vec<String>) -> Self

Set runtime metadata (e.g. declared credential names required to dispatch this task).

Trait Implementations§

Source§

impl Clone for TaskDef

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TaskDef

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TaskDef

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for TaskDef

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for TaskDef

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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