pub struct CaseInit<'a, V: SQLParam> { /* private fields */ }Expand description
Builder state before the first WHEN branch.
The result type is not yet known — it will be set by the first .when().
Implementations§
Source§impl<'a, V: SQLParam + 'a> CaseInit<'a, V>
impl<'a, V: SQLParam + 'a> CaseInit<'a, V>
Sourcepub fn when<C, R>(
self,
condition: C,
result: R,
) -> CaseBuilder<'a, V, R::SQLType, R::Nullable, <C::Aggregate as AggOr<R::Aggregate>>::Output>
pub fn when<C, R>( self, condition: C, result: R, ) -> CaseBuilder<'a, V, R::SQLType, R::Nullable, <C::Aggregate as AggOr<R::Aggregate>>::Output>
Add the first WHEN branch. This establishes the result type.
case().when(gt(users.age, 65), "Senior")
// Type T = Text, Nullability N = NonNull (from &str literal)Auto Trait Implementations§
impl<'a, V> Freeze for CaseInit<'a, V>where
V: Freeze,
impl<'a, V> RefUnwindSafe for CaseInit<'a, V>where
V: RefUnwindSafe,
impl<'a, V> Send for CaseInit<'a, V>
impl<'a, V> Sync for CaseInit<'a, V>where
V: Sync,
impl<'a, V> Unpin for CaseInit<'a, V>where
V: Unpin,
impl<'a, V> UnsafeUnpin for CaseInit<'a, V>where
V: UnsafeUnpin,
impl<'a, V> UnwindSafe for CaseInit<'a, V>where
V: UnwindSafe + RefUnwindSafe,
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