pub struct NullTable<'scope, T> { /* private fields */ }Expand description
A table wrapping another. This table’s rows are assumed null if any of the
non-nullable columns in T are null.
Use Query::nullable to construct this.
Implementations§
Trait Implementations§
Source§impl<'scope, T: ForLifetimeTable + Table<'scope>> ForLifetimeTable for NullTable<'scope, T>
impl<'scope, T: ForLifetimeTable + Table<'scope>> ForLifetimeTable for NullTable<'scope, T>
Source§impl<'scope, T: ShortenLifetime> ShortenLifetime for NullTable<'scope, T>
impl<'scope, T: ShortenLifetime> ShortenLifetime for NullTable<'scope, T>
type Shortened<'small> = NullTable<'small, <T as ShortenLifetime>::Shortened<'small>> where Self: 'small
Source§fn shorten_lifetime<'small, 'large: 'small>(self) -> Self::Shortened<'small>where
Self: 'large,
fn shorten_lifetime<'small, 'large: 'small>(self) -> Self::Shortened<'small>where
Self: 'large,
Shorten a lifetime, normally rust does this automatically, but if
the lifetime is invariant due to being used in a Gat or trait, we
need to do it manually. Read more
Source§impl<'scope, T: Table<'scope>> Table<'scope> for NullTable<'scope, T>
impl<'scope, T: Table<'scope>> Table<'scope> for NullTable<'scope, T>
Source§type Result = Option<<T as Table<'scope>>::Result>
type Result = Option<<T as Table<'scope>>::Result>
The value a row of this table has when loaded from the database.
Source§fn visit(&self, f: &mut impl FnMut(&ErasedExpr), mode: VisitTableMode)
fn visit(&self, f: &mut impl FnMut(&ErasedExpr), mode: VisitTableMode)
Visit each expr in the table. Read more
Source§fn visit_mut(
&mut self,
f: &mut impl FnMut(&mut ErasedExpr),
mode: VisitTableMode,
)
fn visit_mut( &mut self, f: &mut impl FnMut(&mut ErasedExpr), mode: VisitTableMode, )
Visit each expr in the table, with a mutable reference. Read more
Source§impl<T: TableLoaderSqlx> TableLoaderSqlx for NullTable<'static, T>
Available on crate feature sqlx only.
impl<T: TableLoaderSqlx> TableLoaderSqlx for NullTable<'static, T>
Available on crate feature
sqlx only.Source§fn load<'a>(
&self,
values: &mut impl Iterator<Item = PgValueRef<'a>>,
) -> Self::Result
fn load<'a>( &self, values: &mut impl Iterator<Item = PgValueRef<'a>>, ) -> Self::Result
Load the table given an iterator over a row’s values
Source§fn skip<'a>(&self, values: &mut impl Iterator<Item = PgValueRef<'a>>)
fn skip<'a>(&self, values: &mut impl Iterator<Item = PgValueRef<'a>>)
discard N columns from the iterator ofer a row
This is used when this value was discarded by a MaybeTable.
Auto Trait Implementations§
impl<'scope, T> Freeze for NullTable<'scope, T>where
T: Freeze,
impl<'scope, T> !RefUnwindSafe for NullTable<'scope, T>
impl<'scope, T> !Send for NullTable<'scope, T>
impl<'scope, T> !Sync for NullTable<'scope, T>
impl<'scope, T> Unpin for NullTable<'scope, T>where
T: Unpin,
impl<'scope, T> !UnwindSafe for NullTable<'scope, T>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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