pub struct BindIter<I> { /* private fields */ }Expand description
Wraps an iterator to produce a PG array without allocating an intermediate Vec.
Uses size_hint from the iterator for pre-allocation when available.
§Example
ⓘ
use pg::{BindIter, ToSql, types::UUID};
let ids: Vec<uuid::Uuid> = vec![/* ... */];
let param = BindIter::new(ids.iter().copied(), &UUID);
conn.execute_raw("SELECT * FROM unnest($1::uuid[])", &[¶m]).await?;Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<I> !Freeze for BindIter<I>
impl<I> RefUnwindSafe for BindIter<I>
impl<I> Send for BindIter<I>where
I: Send,
impl<I> Sync for BindIter<I>where
I: Send,
impl<I> Unpin for BindIter<I>where
I: Unpin,
impl<I> UnsafeUnpin for BindIter<I>where
I: UnsafeUnpin,
impl<I> UnwindSafe for BindIter<I>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more