Skip to main content

PendingResult

Struct PendingResult 

Source
pub struct PendingResult<'a> { /* private fields */ }
Expand description

Incremental execution of a prepared statement, one task at a time. A pending (incrementally-executed) query, borrowing the statement it runs.

Owns the duckdb_pending_result handle and destroys it in Drop. Borrows the CachedStatement for 'a so the statement (and, through it, the connection) cannot be destroyed while the pending execution references it.

Implementations§

Source§

impl<'a> PendingResult<'a>

Source

pub fn execute_task(&mut self) -> PendingState

Executes a single task, returning the resulting PendingState.

Call repeatedly while the state is NotReady or NoTasksAvailable; stop on Ready (then call execute) or Error.

Source

pub fn check_state(&mut self) -> PendingState

Returns the current PendingState without executing a task.

Source

pub fn error(&self) -> Option<String>

Returns DuckDB’s current error message for this pending result, if any.

Source

pub fn execute(self) -> Result<DuckResult>

Runs the pending execution to completion and returns the materialised DuckResult, consuming self so the result is transferred exactly once.

This drives any remaining tasks internally; call it directly for the simple case, or step with execute_task first when you need to interleave cancellation checks.

§Errors

Returns Error::Engine carrying DuckDB’s classification/message if execution fails.

Trait Implementations§

Source§

impl Drop for PendingResult<'_>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<'a> !Send for PendingResult<'a>

§

impl<'a> !Sync for PendingResult<'a>

§

impl<'a> Freeze for PendingResult<'a>

§

impl<'a> RefUnwindSafe for PendingResult<'a>

§

impl<'a> Unpin for PendingResult<'a>

§

impl<'a> UnsafeUnpin for PendingResult<'a>

§

impl<'a> UnwindSafe for PendingResult<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.