Skip to main content

TaskInfo

Struct TaskInfo 

Source
pub struct TaskInfo {
Show 21 fields pub task_id: String, pub title: String, pub description: String, pub task_type: TaskType, pub poster: Address, pub assignee: Option<Address>, pub max_price: u128, pub quoted_price: Option<u128>, pub status: TaskStatus, pub created_at: Timestamp, pub deadline: Option<u64>, pub required_model: Option<String>, pub preferred_model_id: Option<String>, pub input: String, pub output: Option<String>, pub priority: TaskPriority, pub metadata: HashMap<String, String>, pub tx_hash: Option<String>, pub acceptance_criteria: Option<AcceptanceCriteria>, pub escrow_id: Option<String>, pub dispute: Option<TaskDispute>,
}
Expand description

A task posted to the Tenzro Network task marketplace

Fields§

§task_id: String

Unique task identifier (UUID v4)

§title: String

Short title describing the task

§description: String

Detailed description of the task and expected output

§task_type: TaskType

Type of task

§poster: Address

Address of the entity that posted the task

§assignee: Option<Address>

Optional: agent assigned to fulfill the task

§max_price: u128

Maximum price the poster is willing to pay (in TNZO micro-units)

§quoted_price: Option<u128>

Actual price quoted/agreed (set when task is assigned)

§status: TaskStatus

Current status of the task

§created_at: Timestamp

When the task was posted

§deadline: Option<u64>

Deadline for task completion (Unix timestamp seconds)

§required_model: Option<String>

Minimum model capability required (e.g., “7b”, “70b”, “any”)

§preferred_model_id: Option<String>

Specific model ID to use (if None, any capable model is acceptable)

§input: String

Input data or prompt for the task

§output: Option<String>

Output/result (populated when completed)

§priority: TaskPriority

Task priority level

§metadata: HashMap<String, String>

Additional task-specific metadata

§tx_hash: Option<String>

Transaction hash of the task posting (for escrow reference)

§acceptance_criteria: Option<AcceptanceCriteria>

Structured acceptance criteria / proof spec (Stage 1, P1). When present, completion must satisfy these constraints and, if required_proof is set, carry a proof verified by the SettlementEngine.

§escrow_id: Option<String>

Escrow id that locks the reward once the task is assigned (Stage 3, P0). None until tenzro_assignTask funds the escrow vault.

§dispute: Option<TaskDispute>

Dispute state (P4). None unless tenzro_disputeTask was called.

Implementations§

Source§

impl TaskInfo

Source

pub fn new( title: String, description: String, task_type: TaskType, poster: Address, max_price: u128, input: String, ) -> Self

Creates a new open task

Source

pub fn is_available(&self) -> bool

Returns true if the task can still be accepted by an agent

Source

pub fn is_terminal(&self) -> bool

Returns true if the task is in a terminal state

Trait Implementations§

Source§

impl Clone for TaskInfo

Source§

fn clone(&self) -> TaskInfo

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 TaskInfo

Source§

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

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

impl<'de> Deserialize<'de> for TaskInfo

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 Eq for TaskInfo

Source§

impl PartialEq for TaskInfo

Source§

fn eq(&self, other: &TaskInfo) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for TaskInfo

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

impl StructuralPartialEq for TaskInfo

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
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 = 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.