pub enum ReasoningMode {
Offline,
Ci,
Fast,
Standard,
Strict,
}Expand description
How much independent review a session may use, and where from. The policy reads it
for the review budget; availability reads it to leave advisors out (ci all of them,
offline every one that leaves the machine). standard is the default.
use majordomus_cli::reasoning::availability::ReasoningMode;
assert_eq!(ReasoningMode::default(), ReasoningMode::Standard);
assert_eq!(serde_json::to_value(ReasoningMode::Offline).unwrap(), "offline");
let m: ReasoningMode = serde_json::from_str("\"strict\"").unwrap();
assert_eq!(m, ReasoningMode::Strict);Variants§
Offline
No network: only advisors that stay on this machine.
Ci
Deterministic: no advisor at all, whatever is installed.
Fast
Review only where the blast radius is high.
Standard
Review where uncertainty is material.
Strict
Review wider, and complementary review where the stakes are highest.
Implementations§
Source§impl ReasoningMode
impl ReasoningMode
Sourcepub fn parse(word: &str) -> Option<Self>
pub fn parse(word: &str) -> Option<Self>
The mode a word names, ignoring surrounding whitespace. None for a word that
names no mode: a caller skips it rather than guessing at one.
use majordomus_cli::reasoning::availability::ReasoningMode;
assert_eq!(ReasoningMode::parse(" ci "), Some(ReasoningMode::Ci));
assert_eq!(ReasoningMode::parse("loud"), None);Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
The word that names the mode, as configuration, profiles and plans write it: the
inverse of ReasoningMode::parse.
use majordomus_cli::reasoning::availability::ReasoningMode;
for word in ["offline", "ci", "fast", "standard", "strict"] {
assert_eq!(ReasoningMode::parse(word).unwrap().as_str(), word);
}Trait Implementations§
Source§impl Clone for ReasoningMode
impl Clone for ReasoningMode
Source§fn clone(&self) -> ReasoningMode
fn clone(&self) -> ReasoningMode
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 ReasoningMode
Source§impl Debug for ReasoningMode
impl Debug for ReasoningMode
Source§impl Default for ReasoningMode
impl Default for ReasoningMode
Source§fn default() -> ReasoningMode
fn default() -> ReasoningMode
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ReasoningMode
impl<'de> Deserialize<'de> for ReasoningMode
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 ReasoningMode
Source§impl JsonSchema for ReasoningMode
impl JsonSchema for ReasoningMode
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 Ord for ReasoningMode
impl Ord for ReasoningMode
Source§fn cmp(&self, other: &ReasoningMode) -> Ordering
fn cmp(&self, other: &ReasoningMode) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ReasoningMode
impl PartialEq for ReasoningMode
Source§fn eq(&self, other: &ReasoningMode) -> bool
fn eq(&self, other: &ReasoningMode) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for ReasoningMode
impl PartialOrd for ReasoningMode
Source§impl Serialize for ReasoningMode
impl Serialize for ReasoningMode
impl StructuralPartialEq for ReasoningMode
Auto Trait Implementations§
impl Freeze for ReasoningMode
impl RefUnwindSafe for ReasoningMode
impl Send for ReasoningMode
impl Sync for ReasoningMode
impl Unpin for ReasoningMode
impl UnsafeUnpin for ReasoningMode
impl UnwindSafe for ReasoningMode
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.