pub enum ConditionalTest {
NoValue,
Value,
Boolean,
Blank,
NotBlank,
}Expand description
What a conditional tests about its first argument. There are three different questions, easy to confuse: provided asks whether the use site wrote something here; value, whether there is something to substitute, a declared default value included; blank, whether what would be substituted is empty or holds only comments.
A declared default value is bound before a conditional is evaluated, which is why provided and value are two tests and not one: they differ exactly on an argument that the use site left out and a default value fills.
Variants§
NoValue
\IfNoValue…: the argument is a single placeholder that has nothing to
substitute: not written at the use site and without a declared default
value.
Value
\IfValue…: the negation of NoValue: the
placeholder has something to substitute, a declared default value included.
Boolean
\IfBoolean… and \IfProvided…: the argument is a single placeholder whose
value was written at the use site (typically a * marker), or computed by an
expansion hook. A declared default value does not make this test hold.
Blank
\ifblank: the argument, with its placeholders substituted, is empty or
holds nothing but comments. Whitespace is content, and so are groups and
commands.
NotBlank
\notblank: the negation of Blank.
Trait Implementations§
Source§impl Clone for ConditionalTest
impl Clone for ConditionalTest
impl Copy for ConditionalTest
Source§impl Debug for ConditionalTest
impl Debug for ConditionalTest
impl Eq for ConditionalTest
Source§impl Hash for ConditionalTest
impl Hash for ConditionalTest
Source§impl PartialEq for ConditionalTest
impl PartialEq for ConditionalTest
impl StructuralPartialEq for ConditionalTest
Auto Trait Implementations§
impl Forget for ConditionalTest
impl Freeze for ConditionalTest
impl Move for ConditionalTest
impl RefUnwindSafe for ConditionalTest
impl Send for ConditionalTest
impl Sync for ConditionalTest
impl Unpin for ConditionalTest
impl UnsafeUnpin for ConditionalTest
impl UnwindSafe for ConditionalTest
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
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§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