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