Struct af_postgres::StatementBuilder[][src]

pub struct StatementBuilder<'a> { /* fields omitted */ }

A helper struct for building a complex one-off statement its parameter values.

Implementations

impl<'a> StatementBuilder<'a>[src]

pub fn new() -> Self[src]

Creates a new, empty statement builder.

pub fn append(&mut self, text: impl Display)[src]

Appends text to the query.

pub fn add_param(&mut self, param: &'a (dyn ToSql + Sync)) -> usize[src]

Adds a parameter to the statement and returns its index.

The index is the number to use as a placeholder in statement text. This is intended for adding parameters when the number of parameters is not known at compile time. For example:

write!(builder, "WHERE id = ${}", builder.add_param(id))?;

pub fn params(&self) -> &[&'a (dyn ToSql + Sync)]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Returns a reference to the statement params.

pub fn text(&self) -> &str[src]

Returns a reference to the statement text.

Trait Implementations

impl<'a> Debug for StatementBuilder<'a>[src]

impl Default for StatementBuilder<'_>[src]

impl<'a> Write for StatementBuilder<'a>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for StatementBuilder<'a>

impl<'a> Send for StatementBuilder<'a>

impl<'a> Sync for StatementBuilder<'a>

impl<'a> Unpin for StatementBuilder<'a>

impl<'a> !UnwindSafe for StatementBuilder<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,