pub struct Task {Show 14 fields
pub id: i32,
pub company_id: i32,
pub user_id: i32,
pub agent_id: i32,
pub origin_chat_id: Option<i32>,
pub control_chat_id: Option<i32>,
pub execution_chat_id: Option<i32>,
pub title: String,
pub summary: String,
pub status: Status,
pub ancestry: Option<String>,
pub ancestry_level: i32,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Fields§
§id: i32§company_id: i32§user_id: i32§agent_id: i32§origin_chat_id: Option<i32>Chat from which this task was created.
control_chat_id: Option<i32>Chat from which this task is being controlled (between the user and the Bridge).
execution_chat_id: Option<i32>Chat in which this task is being executed (between the Bridge and the agent).
title: String§summary: String§status: Status§ancestry: Option<String>Task’s parent ids in a form of 1/2/3. None for root tasks.
ancestry_level: i32§created_at: DateTime<Utc>§updated_at: DateTime<Utc>Implementations§
Source§impl Task
impl Task
Sourcepub fn parent_id(&self) -> Result<Option<i32>>
pub fn parent_id(&self) -> Result<Option<i32>>
Returns parent id of the task.
§Errors
Returns error if there was a problem while parsing parent id.
Sourcepub fn parent_ids(&self) -> Result<Option<Vec<i32>>>
pub fn parent_ids(&self) -> Result<Option<Vec<i32>>>
Returns parent ids of the task.
§Errors
Returns error if there was a problem while parsing parent ids.
pub fn children_ancestry(&self) -> String
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>,
Deserialize this value from the given Serde deserializer. 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 UnwindSafe for Task
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> 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>
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