pub struct UnnamedPortal<'a> { /* private fields */ }Expand description
Handle to an unnamed portal for iterative row fetching.
Created by [Conn::exec_iter()]. Use exec() to retrieve rows in batches.
Implementations§
Source§impl<'a> UnnamedPortal<'a>
impl<'a> UnnamedPortal<'a>
Sourcepub fn exec<H: ExtendedHandler>(
&mut self,
max_rows: u32,
handler: &mut H,
) -> Result<bool>
pub fn exec<H: ExtendedHandler>( &mut self, max_rows: u32, handler: &mut H, ) -> Result<bool>
Execute the portal to fetch up to max_rows rows using the provided handler.
Returns Ok(true) if more rows available (PortalSuspended received).
Returns Ok(false) if all rows fetched (CommandComplete received).
Sourcepub fn exec_foreach<T: for<'b> FromRow<'b>, F: FnMut(T) -> Result<()>>(
&mut self,
max_rows: u32,
f: F,
) -> Result<bool>
pub fn exec_foreach<T: for<'b> FromRow<'b>, F: FnMut(T) -> Result<()>>( &mut self, max_rows: u32, f: F, ) -> Result<bool>
Execute the portal and call a closure for each row.
Returns Ok(true) if more rows available (PortalSuspended received).
Returns Ok(false) if all rows fetched (CommandComplete received).
Auto Trait Implementations§
impl<'a> Freeze for UnnamedPortal<'a>
impl<'a> !RefUnwindSafe for UnnamedPortal<'a>
impl<'a> Send for UnnamedPortal<'a>
impl<'a> !Sync for UnnamedPortal<'a>
impl<'a> Unpin for UnnamedPortal<'a>
impl<'a> !UnwindSafe for UnnamedPortal<'a>
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