Skip to main content

Task

Struct Task 

Source
pub struct Task { /* private fields */ }
Expand description

Stable work definition used by the scheduler and execution layer.

Task answers “what work should be done?” rather than “what is the current runtime status?”. Current status is reconstructed from event history in Libra.

Implementations§

Source§

impl Task

Source

pub fn new( created_by: ActorRef, title: impl Into<String>, goal: Option<GoalType>, ) -> Result<Self, String>

Create a new task definition with the given title and optional goal type.

Source

pub fn header(&self) -> &Header

Return the immutable header for this task definition.

Source

pub fn title(&self) -> &str

Return the short task title.

Source

pub fn description(&self) -> Option<&str>

Return the longer-form task description, if present.

Source

pub fn goal(&self) -> Option<&GoalType>

Return the coarse work classification, if present.

Source

pub fn constraints(&self) -> &[String]

Return the explicit task constraints.

Source

pub fn acceptance_criteria(&self) -> &[String]

Return the acceptance criteria for task completion.

Source

pub fn requester(&self) -> Option<&ActorRef>

Return the requesting actor, if one was stored.

Source

pub fn parent(&self) -> Option<Uuid>

Return the parent task id, if this task was derived from another task.

Source

pub fn intent(&self) -> Option<Uuid>

Return the originating intent id, if present.

Source

pub fn origin_step_id(&self) -> Option<Uuid>

Return the stable plan-step id that originally spawned this task, if present.

Source

pub fn dependencies(&self) -> &[Uuid]

Return the task dependency list.

Source

pub fn set_description(&mut self, description: Option<String>)

Set or clear the long-form task description.

Source

pub fn add_constraint(&mut self, constraint: impl Into<String>)

Append one execution constraint to this task definition.

Source

pub fn add_acceptance_criterion(&mut self, criterion: impl Into<String>)

Append one acceptance criterion to this task definition.

Source

pub fn set_requester(&mut self, requester: Option<ActorRef>)

Set or clear the requesting actor for this task.

Source

pub fn set_parent(&mut self, parent: Option<Uuid>)

Set or clear the parent task link.

Source

pub fn set_intent(&mut self, intent: Option<Uuid>)

Set or clear the originating intent link.

Source

pub fn set_origin_step_id(&mut self, origin_step_id: Option<Uuid>)

Set or clear the originating stable plan-step link.

Source

pub fn add_dependency(&mut self, task_id: Uuid)

Append one prerequisite task id to the dependency list.

Trait Implementations§

Source§

impl Clone for Task

Source§

fn clone(&self) -> Task

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Task

Source§

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

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

impl<'de> Deserialize<'de> for Task

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 Display for Task

Source§

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

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

impl ObjectTrait for Task

Source§

fn from_bytes(data: &[u8], _hash: ObjectHash) -> Result<Self, GitError>
where Self: Sized,

Creates a new object from a byte slice.
Source§

fn get_type(&self) -> ObjectType

Returns the type of the object.
Source§

fn get_size(&self) -> usize

Source§

fn to_data(&self) -> Result<Vec<u8>, GitError>

Source§

fn from_buf_read<R: BufRead>(read: &mut ReadBoxed<R>, size: usize) -> Self
where Self: Sized,

Generate a new Object from a ReadBoxed<BufRead>. the input size,is only for new a vec with directive space allocation the input data stream and output object should be plain base object .
Source§

fn object_hash(&self) -> Result<ObjectHash, GitError>

Source§

impl Serialize for Task

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§

§

impl Freeze for Task

§

impl RefUnwindSafe for Task

§

impl Send for Task

§

impl Sync for Task

§

impl Unpin for Task

§

impl UnsafeUnpin for Task

§

impl UnwindSafe for Task

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> FileLoadStore for T
where T: Serialize + for<'a> Deserialize<'a>,

Source§

fn f_load(path: &Path) -> Result<T, Error>

load object from file

Source§

fn f_save(&self, path: &Path) -> Result<(), Error>

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
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> IntoEither for T

Source§

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.
Source§

impl<T> ValueSize for T

Source§

fn value_size(&self) -> usize

The size of this value in bytes, excluding allocated data. Read more
Source§

fn value_size_sum_iter<'item>(iterator: impl Iterator<Item = &'item T>) -> usize
where T: 'item,

The total sum of the sizes of all values in the given iterator, in bytes. This is default-implemented by computing ValueSize::value_size on every element and summing them. For Sized types, a more potentially efficient implementation using Iterator::count is provided. If you are implementing this trait manually, it is unlikely to be more efficient to provide a manual implementation here. Read more
Source§

fn value_size_sum_exact_size_iter<'item>( iterator: impl ExactSizeIterator<Item = &'item T>, ) -> usize
where T: 'item,

The total sum of the sizes of all values in the given exact-size-iterator, in bytes. This is default-implemented by using ValueSize::value_size_sum_iter. For Sized types, a usually more efficient implementation using ExactSizeIterator::len is provided. If you are implementing this trait manually, it is unlikely to be more efficient to provide a manual implementation here. Read more
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
Source§

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

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,