pub struct Task {
pub session: String,
pub pid: u32,
pub pid_since: Option<u64>,
pub started_ms: u64,
pub updated_ms: u64,
pub prompt: String,
pub state: State,
pub last: String,
pub detail: String,
}Expand description
One background run.
Fields§
§session: StringThe task is identified by the session it runs in: one run, one transcript, and
eclipse --plain -s <id> opens it without a second id to remember.
pid: u32The process doing the work. Read through, never trusted: see Task::state_now.
pid_since: Option<u64>The kernel’s start time for that pid, in clock ticks since boot. With the pid this is what makes “the same process” a question with an answer.
started_ms: u64When the task was spawned.
updated_ms: u64The last write: when it started, what it last did, or how it ended.
prompt: StringThe question it was given, cut to something a row can hold.
state: State§last: StringThe last thing it did, in one line: tool shell, replied, turn 3 · 4.1K tok.
detail: StringWhy it ended, when ending needs a reason.
Implementations§
Source§impl Task
impl Task
Sourcepub fn spawned(session: &str, pid: u32, prompt: &str) -> Task
pub fn spawned(session: &str, pid: u32, prompt: &str) -> Task
The entry the parent writes the moment the child is spawned.
Written by the parent, not the child, so /tasks straight after /bg already has a row:
a run that is invisible for its first hundred milliseconds is a run someone will ask
twice about.
Sourcepub fn begun(session: &str, prompt: &str) -> Task
pub fn begun(session: &str, prompt: &str) -> Task
The entry the child writes for itself once it is running.
Sourcepub fn state_now(&self) -> State
pub fn state_now(&self) -> State
The state this entry is honestly in now.
A stored running whose process is gone is State::Died. Everything else is what the
child wrote, because a finished task has no process left to ask.
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>,
impl Eq for Task
impl StructuralPartialEq for Task
Auto Trait Implementations§
impl Forget for Task
impl Freeze for Task
impl Move for Task
impl RefUnwindSafe for Task
impl Send for Taskwhere
RawVecInner: Send,
impl Sync for Taskwhere
RawVecInner: Sync,
impl Unpin for Task
impl UnsafeUnpin for Task
impl UnwindSafe for Taskwhere
RawVecInner: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.