Trait tokio_postgres::types::BorrowToSql
source · [−]pub trait BorrowToSql: Sealed {
fn borrow_to_sql(&self) -> &dyn ToSql;
}
Expand description
A trait used by clients to abstract over &dyn ToSql
and T: ToSql
.
This cannot be implemented outside of this crate.
Required Methods
fn borrow_to_sql(&self) -> &dyn ToSql
fn borrow_to_sql(&self) -> &dyn ToSql
Returns a reference to self
as a ToSql
trait object.
Implementations on Foreign Types
sourceimpl BorrowToSql for Box<dyn ToSql + Sync + 'static, Global>
impl BorrowToSql for Box<dyn ToSql + Sync + 'static, Global>
fn borrow_to_sql(&self) -> &dyn ToSql
sourceimpl BorrowToSql for Box<dyn ToSql + Send + Sync + 'static, Global>
impl BorrowToSql for Box<dyn ToSql + Send + Sync + 'static, Global>
fn borrow_to_sql(&self) -> &dyn ToSql
Implementors
impl<'_> BorrowToSql for &'_ (dyn ToSql + '_)
impl<'_> BorrowToSql for &'_ (dyn ToSql + Sync + '_)
In async contexts it is sometimes necessary to have the additional Sync requirement on parameters for queries since this enables the resulting Futures to be Send, hence usable in, e.g., tokio::spawn. This instance is provided for those cases.