Enum term_transcript::test::UpdateMode
source · #[non_exhaustive]pub enum UpdateMode {
Never,
Always,
}
Available on crate features
test
and svg
only.Expand description
Strategy for saving a new snapshot on a test failure within TestConfig::test()
and
related methods.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Never
Never create a new snapshot on test failure.
Always
Always create a new snapshot on test failure.
Implementations§
source§impl UpdateMode
impl UpdateMode
sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Reads the update mode from the TERM_TRANSCRIPT_UPDATE
env variable.
If the TERM_TRANSCRIPT_UPDATE
variable is not set, the output depends on whether
the executable is running in CI (which is detected by the presence of
the CI
env variable):
- In CI, the method returns
Self::Never
. - Otherwise, the method returns
Self::Always
.
Panics
If the TERM_TRANSCRIPT_UPDATE
env variable is set to an unrecognized value
(something other than never
or always
), this method will panic.
Trait Implementations§
source§impl Clone for UpdateMode
impl Clone for UpdateMode
source§fn clone(&self) -> UpdateMode
fn clone(&self) -> UpdateMode
Returns a copy of the value. Read more
1.0.0 · 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 UpdateMode
impl Debug for UpdateMode
source§impl Hash for UpdateMode
impl Hash for UpdateMode
source§impl PartialEq<UpdateMode> for UpdateMode
impl PartialEq<UpdateMode> for UpdateMode
source§fn eq(&self, other: &UpdateMode) -> bool
fn eq(&self, other: &UpdateMode) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for UpdateMode
impl Eq for UpdateMode
impl StructuralEq for UpdateMode
impl StructuralPartialEq for UpdateMode
Auto Trait Implementations§
impl RefUnwindSafe for UpdateMode
impl Send for UpdateMode
impl Sync for UpdateMode
impl Unpin for UpdateMode
impl UnwindSafe for UpdateMode
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.