pub enum ArgOr<V> {
Arg(usize),
Value(V),
}Expand description
Matches either an extracted bind-parameter placeholder (Expr::Arg, emitted
by SQL drivers after parameter extraction) at a specific position, or an
inline Expr::Value matching the contained pattern (emitted by non-SQL
drivers like DynamoDB).
Use this when a single assertion needs to cover both representations:
ⓘ
let val = if test.capability().sql() {
ArgOr::Arg(0)
} else {
ArgOr::Value(1i64)
};
assert_struct!(op, ..., rows: [=~ (Any, Any, val)]);Variants§
Arg(usize)
Matches Expr::Arg(_) whose position equals the given index.
Value(V)
Matches Expr::Value(_) using the inner pattern via Like<V>.
Trait Implementations§
Auto Trait Implementations§
impl<V> Freeze for ArgOr<V>where
V: Freeze,
impl<V> RefUnwindSafe for ArgOr<V>where
V: RefUnwindSafe,
impl<V> Send for ArgOr<V>where
V: Send,
impl<V> Sync for ArgOr<V>where
V: Sync,
impl<V> Unpin for ArgOr<V>where
V: Unpin,
impl<V> UnsafeUnpin for ArgOr<V>where
V: UnsafeUnpin,
impl<V> UnwindSafe for ArgOr<V>where
V: UnwindSafe,
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> ErasedDestructor for Twhere
T: 'static,
§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