Skip to main content

GoalRef

Enum GoalRef 

Source
pub enum GoalRef {
    Charter(String),
    Task(String),
    Setpoint(String),
}
Expand description

What a piece of work serves.

Variants§

§

Charter(String)

A standing commitment from the charter (see crate::charter). The id is a crate::charter::CharterLine’s own id.

Rank is the charter’s line order, and is deliberately not carried here. Standing commitments conflict — protecting the owner against not letting a colleague down — and value conflict is the measured cause of goal drift, so the resolution has to be a total order rather than weights: no quantity of a lower commitment outranks a higher one, which is what makes “this is urgent for very many people” a non-argument. Order in the file is that order, on TASK-AGENT-DESIGN.md R1’s rule one noun over — priority derives from the record and is never a field anybody maintains, because a second statement of urgency disagrees with the first the moment either is edited.

§

Task(String)

A task on the GTD board, by the graph’s own uid.

§

Setpoint(String)

A homeostatic setpoint, by name. No store yet.

Implementations§

Source§

impl GoalRef

Source

pub fn kind(&self) -> &'static str

The kind word used on the wire.

Source

pub fn id(&self) -> &str

The identifier this points at, without its kind.

Source

pub fn parse_lenient(s: &str) -> Option<GoalRef>

Parse leniently: anything unrecognised is no reference.

The reader for records. See the module note — a transcript written by a newer binary must not cost the plan that surrounds it.

Trait Implementations§

Source§

impl Clone for GoalRef

Source§

fn clone(&self) -> GoalRef

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for GoalRef

Source§

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

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

impl Display for GoalRef

Source§

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

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

impl Eq for GoalRef

Source§

impl FromStr for GoalRef

Source§

type Err = ParseGoalRefError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl PartialEq for GoalRef

Source§

fn eq(&self, other: &GoalRef) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for GoalRef

Serialised as the same kind:id string the model writes, never as an object.

One spelling on every wire this type crosses. A derived impl would give a stored record a second shape — {"Task": "01J8ZK"} — and then “what does a goal reference look like” would have two answers depending on which file you opened, which is how a reader written against one silently mis-reads the other.

Source§

fn serialize<S: Serializer>(&self, s: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for GoalRef

Auto Trait Implementations§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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 = !

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