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
impl Task
Sourcepub fn new(
created_by: ActorRef,
title: impl Into<String>,
goal: Option<GoalType>,
) -> Result<Self, String>
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.
Sourcepub fn description(&self) -> Option<&str>
pub fn description(&self) -> Option<&str>
Return the longer-form task description, if present.
Sourcepub fn constraints(&self) -> &[String]
pub fn constraints(&self) -> &[String]
Return the explicit task constraints.
Sourcepub fn acceptance_criteria(&self) -> &[String]
pub fn acceptance_criteria(&self) -> &[String]
Return the acceptance criteria for task completion.
Sourcepub fn parent(&self) -> Option<Uuid>
pub fn parent(&self) -> Option<Uuid>
Return the parent task id, if this task was derived from another task.
Sourcepub fn origin_step_id(&self) -> Option<Uuid>
pub fn origin_step_id(&self) -> Option<Uuid>
Return the stable plan-step id that originally spawned this task, if present.
Sourcepub fn dependencies(&self) -> &[Uuid]
pub fn dependencies(&self) -> &[Uuid]
Return the task dependency list.
Sourcepub fn set_description(&mut self, description: Option<String>)
pub fn set_description(&mut self, description: Option<String>)
Set or clear the long-form task description.
Sourcepub fn add_constraint(&mut self, constraint: impl Into<String>)
pub fn add_constraint(&mut self, constraint: impl Into<String>)
Append one execution constraint to this task definition.
Sourcepub fn add_acceptance_criterion(&mut self, criterion: impl Into<String>)
pub fn add_acceptance_criterion(&mut self, criterion: impl Into<String>)
Append one acceptance criterion to this task definition.
Sourcepub fn set_requester(&mut self, requester: Option<ActorRef>)
pub fn set_requester(&mut self, requester: Option<ActorRef>)
Set or clear the requesting actor for this task.
Sourcepub fn set_parent(&mut self, parent: Option<Uuid>)
pub fn set_parent(&mut self, parent: Option<Uuid>)
Set or clear the parent task link.
Sourcepub fn set_intent(&mut self, intent: Option<Uuid>)
pub fn set_intent(&mut self, intent: Option<Uuid>)
Set or clear the originating intent link.
Sourcepub fn set_origin_step_id(&mut self, origin_step_id: Option<Uuid>)
pub fn set_origin_step_id(&mut self, origin_step_id: Option<Uuid>)
Set or clear the originating stable plan-step link.
Sourcepub fn add_dependency(&mut self, task_id: Uuid)
pub fn add_dependency(&mut self, task_id: Uuid)
Append one prerequisite task id to the dependency list.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Task
impl<'de> Deserialize<'de> for Task
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 ObjectTrait for Task
impl ObjectTrait for Task
Source§fn from_bytes(data: &[u8], _hash: ObjectHash) -> Result<Self, GitError>where
Self: Sized,
fn from_bytes(data: &[u8], _hash: ObjectHash) -> Result<Self, GitError>where
Self: Sized,
Source§fn get_type(&self) -> ObjectType
fn get_type(&self) -> ObjectType
fn get_size(&self) -> usize
fn to_data(&self) -> Result<Vec<u8>, GitError>
Source§fn from_buf_read<R: BufRead>(read: &mut ReadBoxed<R>, size: usize) -> Selfwhere
Self: Sized,
fn from_buf_read<R: BufRead>(read: &mut ReadBoxed<R>, size: usize) -> Selfwhere
Self: Sized,
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 .fn object_hash(&self) -> Result<ObjectHash, GitError>
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> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.