Skip to main content

TypedCompiled

Struct TypedCompiled 

Source
pub struct TypedCompiled<T> {
    pub sql: String,
    pub params: Vec<Param>,
    pub data: Vec<u8>,
    pub marker: PhantomData<T>,
}
Expand description

Fully compiled query payload with an attached row type.

Fields§

§sql: String

Final SQL string ready to hand to a driver.

§params: Vec<Param>

Compact parameter values referenced by the SQL string.

§data: Vec<u8>

Interned text and blob storage referenced by params.

§marker: PhantomData<T>

Row type marker.

Implementations§

Source§

impl<T> TypedCompiled<T>

Source

pub async fn fetch<'e, E>( self, exec: &'e mut E, ) -> Result<<E as Executor>::Rows<'e>, Error>
where T: FromRow, E: Executor + ?Sized,

Source

pub async fn execute<E>(self, exec: E) -> Result<ExecResult, Error>
where E: Executor,

Source§

impl<T> TypedCompiled<T>
where T: FromRow,

Source

pub async fn all<E>(self, exec: E) -> Result<Vec<T>, Error>
where E: Executor,

Source

pub async fn one<E>(self, exec: E) -> Result<T, Error>
where E: Executor,

Source

pub async fn optional<E>(self, exec: E) -> Result<Option<T>, Error>
where E: Executor,

Trait Implementations§

Source§

impl<T> Debug for TypedCompiled<T>
where T: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> Freeze for TypedCompiled<T>

§

impl<T> RefUnwindSafe for TypedCompiled<T>
where T: RefUnwindSafe,

§

impl<T> Send for TypedCompiled<T>
where T: Send,

§

impl<T> Sync for TypedCompiled<T>
where T: Sync,

§

impl<T> Unpin for TypedCompiled<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for TypedCompiled<T>

§

impl<T> UnwindSafe for TypedCompiled<T>
where T: 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, 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<Key> RelationForeignKey<Key> for Key

Source§

fn from_relation_key(key: Key) -> Key

Source§

impl<Key, T> RelationForeignKeyRef<Key> for T
where Key: Clone, T: RelationForeignKey<Key>,

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.