pub enum Assertion {
IsDefined,
IsNotEmptyString,
IsString,
IsNumber,
IsBool,
IsNotCompound,
IsValidSortTag,
IsConfiguredScheme,
IsTpnoteExtension,
NoOperation,
}
Expand description
Describes a set of tests, that assert template variable tera:Value
properties.
Variants§
IsDefined
IsDefined
: Assert that the variable is defined in the template.
IsNotEmptyString
IsNotEmptyString
: In addition to IsString
, the condition asserts,
that the string -or all substrings-) are not empty.
IsString
IsString
: Assert, that if the variable is defined, its type -or all
subtypes- are Value::String
.
IsNumber
IsNumber
: Assert, that if the variable is defined, its type -or all
subtypes- are Value::Number
.
IsBool
IsBool
: Assert, that if the variable is defined, its type -or all
subtypes- are Value::Bool
.
IsNotCompound
IsNotCompound
: Assert, that if the variable is defined, its type is
not Value::Array
or Value::Object
.
IsValidSortTag
IsValidSortTag
: Assert, that if the variable is defined, the value’s
string representation contains solely characters of the
filename.sort_tag.extra_chars
set, digits or lowercase letters.
The number of lowercase letters in a row is limited by
tpnote_lib::config::FILENAME_SORT_TAG_LETTERS_IN_SUCCESSION_MAX
.
IsConfiguredScheme
IsConfiguredScheme
: Assert, that -if the variable is defined- the
string equals to one of the scheme.name
in the configuration file.
IsTpnoteExtension
IsTpnoteExtension
: Assert, that if the variable is defined,
the values string representation is registered in one of the
filename.extension_*
configuration file variables.
NoOperation
NoOperation
(default): A test that is always satisfied. For internal
use only.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Assertion
impl<'de> Deserialize<'de> for Assertion
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>,
impl Copy for Assertion
impl Eq for Assertion
impl StructuralPartialEq for Assertion
Auto Trait Implementations§
impl Freeze for Assertion
impl RefUnwindSafe for Assertion
impl Send for Assertion
impl Sync for Assertion
impl Unpin for Assertion
impl UnwindSafe for Assertion
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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>
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