Skip to main content

List

Struct List 

Source
pub struct List<M>(/* private fields */);
Expand description

A sized marker type representing “list of M”.

Used as a type parameter to [Statement], Load, and other types to encode that the result is a collection of M values. Unlike [M] (which is unsized), List<M> is always Sized, so it composes cleanly in tuples: (List<User>, List<Todo>) is valid.

Trait Implementations§

Source§

impl<T, E: IntoExpr<T>> Assign<List<T>> for &[E]

Source§

fn into_assignment(self) -> Assignment<List<T>>

Convert into an Assignment<T> value.
Source§

fn assign(self, assignments: &mut Assignments, projection: Projection)
where Self: Sized,

Record one or more assignments into the given [Assignments] map at the specified projection.
Source§

impl<T, U: IntoExpr<T>, const N: usize> Assign<List<T>> for &[U; N]

Source§

fn into_assignment(self) -> Assignment<List<T>>

Convert into an Assignment<T> value.
Source§

fn assign(self, assignments: &mut Assignments, projection: Projection)
where Self: Sized,

Record one or more assignments into the given [Assignments] map at the specified projection.
Source§

impl<T, U: IntoExpr<T>, const N: usize> Assign<List<T>> for [U; N]

Source§

fn into_assignment(self) -> Assignment<List<T>>

Convert into an Assignment<T> value.
Source§

fn assign(self, assignments: &mut Assignments, projection: Projection)
where Self: Sized,

Record one or more assignments into the given [Assignments] map at the specified projection.
Source§

impl<T, U: IntoExpr<T>> Assign<List<T>> for Vec<U>

Source§

fn into_assignment(self) -> Assignment<List<T>>

Convert into an Assignment<T> value.
Source§

fn assign(self, assignments: &mut Assignments, projection: Projection)
where Self: Sized,

Record one or more assignments into the given [Assignments] map at the specified projection.
Source§

impl<M: Model> IntoExpr<List<M>> for CreateMany<M>

Source§

fn into_expr(self) -> Expr<List<M>>

Consume self and produce an Expr<T>. Read more
Source§

fn by_ref(&self) -> Expr<List<M>>

Produce an Expr<T> from a reference without consuming self. Read more
Source§

impl<T, E: IntoExpr<T>> IntoExpr<List<T>> for &[E]

Source§

fn into_expr(self) -> Expr<List<T>>

Consume self and produce an Expr<T>. Read more
Source§

fn by_ref(&self) -> Expr<List<T>>

Produce an Expr<T> from a reference without consuming self. Read more
Source§

impl<T, U, const N: usize> IntoExpr<List<T>> for &[U; N]
where U: IntoExpr<T>,

Source§

fn into_expr(self) -> Expr<List<T>>

Consume self and produce an Expr<T>. Read more
Source§

fn by_ref(&self) -> Expr<List<T>>

Produce an Expr<T> from a reference without consuming self. Read more
Source§

impl<T, U, const N: usize> IntoExpr<List<T>> for [U; N]
where U: IntoExpr<T>,

Source§

fn into_expr(self) -> Expr<List<T>>

Consume self and produce an Expr<T>. Read more
Source§

fn by_ref(&self) -> Expr<List<T>>

Produce an Expr<T> from a reference without consuming self. Read more
Source§

impl<T, U> IntoExpr<List<T>> for Vec<U>
where U: IntoExpr<T>,

Source§

fn into_expr(self) -> Expr<List<T>>

Consume self and produce an Expr<T>. Read more
Source§

fn by_ref(&self) -> Expr<List<T>>

Produce an Expr<T> from a reference without consuming self. Read more
Source§

impl<M: Load> Load for List<M>

List type encoding: List<M> loads as Vec<M::Output>.

Source§

type Output = Vec<<M as Load>::Output>

The concrete type produced by load. Read more
Source§

fn ty() -> Type

Returns the stmt::Type that describes values of this type.
Source§

fn load(value: Value) -> Result<Self::Output, Error>

Deserialize a database Value into Self::Output. Read more
Source§

fn ty_relation() -> Type

Returns the stmt::Type used when this type appears as a relation target. The default delegates to ty().
Source§

fn load_relation(value: Value) -> Result<Self::Output, Error>

Deserialize a value that was loaded as a relation target. Read more
Source§

fn reload(target: &mut Self::Output, value: Value) -> Result<(), Error>

Reload the value in-place from a value returned by the database. Read more

Auto Trait Implementations§

§

impl<M> Freeze for List<M>

§

impl<M> RefUnwindSafe for List<M>
where M: RefUnwindSafe,

§

impl<M> Send for List<M>
where M: Send,

§

impl<M> Sync for List<M>
where M: Sync,

§

impl<M> Unpin for List<M>
where M: Unpin,

§

impl<M> UnsafeUnpin for List<M>

§

impl<M> UnwindSafe for List<M>
where M: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more