Struct leetcode_tui_rs::migrations::sea_orm::Selector
source · pub struct Selector<S>where
S: SelectorTrait,{ /* private fields */ }
Expand description
Defines a type to do SELECT
operations through a SelectStatement on a Model
Implementations§
source§impl<S> Selector<S>where
S: SelectorTrait,
impl<S> Selector<S>where S: SelectorTrait,
sourcepub fn with_columns<T, C>(
query: SelectStatement
) -> Selector<SelectGetableValue<T, C>>where
T: TryGetableMany,
C: IntoEnumIterator + Iden,
pub fn with_columns<T, C>( query: SelectStatement ) -> Selector<SelectGetableValue<T, C>>where T: TryGetableMany, C: IntoEnumIterator + Iden,
Create Selector
from Statement and columns. Executing this Selector
will return a type T
which implement TryGetableMany
.
sourcepub fn into_tuple<T>(query: SelectStatement) -> Selector<SelectGetableTuple<T>>where
T: TryGetableMany,
pub fn into_tuple<T>(query: SelectStatement) -> Selector<SelectGetableTuple<T>>where T: TryGetableMany,
Get tuple from query result based on column index
sourcepub async fn one<'a, C>(
self,
db: &C
) -> impl Future<Output = Result<Option<<S as SelectorTrait>::Item>, DbErr>>where
C: ConnectionTrait,
pub async fn one<'a, C>( self, db: &C ) -> impl Future<Output = Result<Option<<S as SelectorTrait>::Item>, DbErr>>where C: ConnectionTrait,
Get an item from the Select query
sourcepub async fn all<'a, C>(
self,
db: &C
) -> impl Future<Output = Result<Vec<<S as SelectorTrait>::Item, Global>, DbErr>>where
C: ConnectionTrait,
pub async fn all<'a, C>( self, db: &C ) -> impl Future<Output = Result<Vec<<S as SelectorTrait>::Item, Global>, DbErr>>where C: ConnectionTrait,
Get all items from the Select query
sourcepub async fn stream<'a, 'b, C>(
self,
db: &'a C
) -> impl Future<Output = Result<Pin<Box<dyn Stream<Item = Result<<S as SelectorTrait>::Item, DbErr>> + Send + 'b, Global>>, DbErr>>where
'a: 'b,
C: ConnectionTrait + StreamTrait + Send,
S: 'b,
<S as SelectorTrait>::Item: Send,
pub async fn stream<'a, 'b, C>( self, db: &'a C ) -> impl Future<Output = Result<Pin<Box<dyn Stream<Item = Result<<S as SelectorTrait>::Item, DbErr>> + Send + 'b, Global>>, DbErr>>where 'a: 'b, C: ConnectionTrait + StreamTrait + Send, S: 'b, <S as SelectorTrait>::Item: Send,
Stream the results of the Select operation
Trait Implementations§
source§impl<'db, C, S> PaginatorTrait<'db, C> for Selector<S>where
C: ConnectionTrait,
S: SelectorTrait + Send + Sync + 'db,
impl<'db, C, S> PaginatorTrait<'db, C> for Selector<S>where C: ConnectionTrait, S: SelectorTrait + Send + Sync + 'db,
Auto Trait Implementations§
impl<S> !RefUnwindSafe for Selector<S>
impl<S> Send for Selector<S>where S: Send,
impl<S> Sync for Selector<S>where S: Sync,
impl<S> Unpin for Selector<S>where S: Unpin,
impl<S> !UnwindSafe for Selector<S>
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