pub enum WorkStanding {
Held,
Recent,
Abandoned,
}Expand description
What a work tree’s uncommitted work is, judged: held by something, recent, or abandoned.
judge is the one place it is decided, and doctor warns only on abandoned.
use majordomus_cli::worktree::uncommitted::{judge, WorkStanding};
let standing = judge(false, Some(90_000), Some(43_200));
assert_eq!(standing, WorkStanding::Abandoned);
assert_eq!(serde_json::to_value(standing).unwrap(), "abandoned");Variants§
Held
A task, an episode or a process holds it.
Recent
Nothing holds it, and it is younger than the threshold.
Abandoned
Nothing holds it, and it is older than the threshold — or its age cannot be read.
Implementations§
Source§impl WorkStanding
impl WorkStanding
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
The standing as one lowercase word, the same word the JSON answer carries, for the
text rendering of worktree uncommitted and for doctor’s selection of what to warn on.
use majordomus_cli::worktree::WorkStanding;
for s in [WorkStanding::Held, WorkStanding::Recent, WorkStanding::Abandoned] {
assert_eq!(serde_json::to_value(s).unwrap(), s.as_str(), "one word on both surfaces");
}Trait Implementations§
Source§impl Clone for WorkStanding
impl Clone for WorkStanding
Source§fn clone(&self) -> WorkStanding
fn clone(&self) -> WorkStanding
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 moreimpl Copy for WorkStanding
Source§impl Debug for WorkStanding
impl Debug for WorkStanding
Source§impl<'de> Deserialize<'de> for WorkStanding
impl<'de> Deserialize<'de> for WorkStanding
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 WorkStanding
Source§impl JsonSchema for WorkStanding
impl JsonSchema for WorkStanding
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 WorkStanding
impl PartialEq for WorkStanding
Source§fn eq(&self, other: &WorkStanding) -> bool
fn eq(&self, other: &WorkStanding) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for WorkStanding
impl Serialize for WorkStanding
impl StructuralPartialEq for WorkStanding
Auto Trait Implementations§
impl Freeze for WorkStanding
impl RefUnwindSafe for WorkStanding
impl Send for WorkStanding
impl Sync for WorkStanding
impl Unpin for WorkStanding
impl UnsafeUnpin for WorkStanding
impl UnwindSafe for WorkStanding
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.