pub struct IntentWorkUnit {
pub kind: IntentWorkKind,
pub id: String,
pub title: String,
pub outcome: String,
pub branches: Vec<String>,
pub scope: Vec<String>,
pub episodes: Vec<IntentEpisode>,
pub handovers: Vec<String>,
pub named_issues: Vec<String>,
pub moved_issues: Vec<String>,
}Expand description
One unit of work as its records describe it, before it is joined to any intent.
use majordomus_cli::intent_realization::{IntentWorkKind, IntentWorkUnit};
let unit = IntentWorkUnit::new(IntentWorkKind::Task, "t-1");
assert!(unit.episodes.is_empty());
assert_eq!(unit.id, "t-1");Fields§
§kind: IntentWorkKindWhich record it was read from.
id: StringIts identity in that record: a task id, a session id, or <peer>/<claim>.
title: StringWhat it says it is, in its own words.
outcome: StringWhere it stands: a task’s outcome, a session’s, or attached/departed for a claim.
branches: Vec<String>The branches it ran on, in first-seen order.
scope: Vec<String>The paths it claims.
episodes: Vec<IntentEpisode>Every episode that worked on it, in first-seen order.
handovers: Vec<String>The handovers that carried it from one episode to the next, repository-relative.
named_issues: Vec<String>Issue ids its own words cite.
moved_issues: Vec<String>Issue ids a recorded event shows it moving.
Implementations§
Source§impl IntentWorkUnit
impl IntentWorkUnit
Sourcepub fn new(kind: IntentWorkKind, id: &str) -> IntentWorkUnit
pub fn new(kind: IntentWorkKind, id: &str) -> IntentWorkUnit
An empty unit of a kind and id, for a reader to fill.
use majordomus_cli::intent_realization::{IntentWorkKind, IntentWorkUnit};
let u = IntentWorkUnit::new(IntentWorkKind::PeerClaim, "p3/x");
assert_eq!(u.kind, IntentWorkKind::PeerClaim);Sourcepub fn providers(&self) -> Vec<String>
pub fn providers(&self) -> Vec<String>
The providers that ran it, each once, in first-seen order.
use majordomus_cli::intent_realization::{IntentEpisode, IntentWorkKind, IntentWorkUnit};
let mut u = IntentWorkUnit::new(IntentWorkKind::Task, "t-1");
for p in ["claude-code", "codex", "claude-code", ""] {
u.episodes.push(IntentEpisode {
session: String::new(), provider: p.into(), provider_session: String::new() });
}
assert_eq!(u.providers(), ["claude-code", "codex"]);Trait Implementations§
Source§impl Clone for IntentWorkUnit
impl Clone for IntentWorkUnit
Source§fn clone(&self) -> IntentWorkUnit
fn clone(&self) -> IntentWorkUnit
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IntentWorkUnit
impl Debug for IntentWorkUnit
Source§impl<'de> Deserialize<'de> for IntentWorkUnit
impl<'de> Deserialize<'de> for IntentWorkUnit
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
impl Eq for IntentWorkUnit
Source§impl JsonSchema for IntentWorkUnit
impl JsonSchema for IntentWorkUnit
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for IntentWorkUnit
impl PartialEq for IntentWorkUnit
Source§fn eq(&self, other: &IntentWorkUnit) -> bool
fn eq(&self, other: &IntentWorkUnit) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for IntentWorkUnit
impl Serialize for IntentWorkUnit
impl StructuralPartialEq for IntentWorkUnit
Auto Trait Implementations§
impl Freeze for IntentWorkUnit
impl RefUnwindSafe for IntentWorkUnit
impl Send for IntentWorkUnit
impl Sync for IntentWorkUnit
impl Unpin for IntentWorkUnit
impl UnsafeUnpin for IntentWorkUnit
impl UnwindSafe for IntentWorkUnit
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.