pub enum CheckMode {
Check,
Write,
CheckAndWrite,
}Variants§
Implementations§
Source§impl CheckMode
impl CheckMode
Sourcepub(crate) fn parse(args: &[String], usage: &str) -> Result<Option<Self>>
pub(crate) fn parse(args: &[String], usage: &str) -> Result<Option<Self>>
Parses the --write/--check flag pair shared by every
regenerate-or-verify xtask command (check-openapi,
check-schema-docs, check-ts-client).
Returns Ok(None) when --help was handled and the caller should do
nothing else. That is why this returns an Option rather than a bare
CheckMode: printing usage and then running the command anyway (which
is what returning a default mode here used to do) surprises anyone who
asked what a command does and got it done to them instead.
pub(crate) fn should_check(self) -> bool
pub(crate) fn should_write(self) -> bool
Trait Implementations§
impl Copy for CheckMode
impl Eq for CheckMode
impl StructuralPartialEq for CheckMode
Auto Trait Implementations§
impl Freeze for CheckMode
impl RefUnwindSafe for CheckMode
impl Send for CheckMode
impl Sync for CheckMode
impl Unpin for CheckMode
impl UnsafeUnpin for CheckMode
impl UnwindSafe for CheckMode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more