Skip to main content

EagerOpRef

Struct EagerOpRef 

Source
pub struct EagerOpRef<T, E> { /* private fields */ }
Expand description

Eager operation reference for local/synchronous operations.

This is a simple wrapper for synchronous operations that complete immediately. The result is stored and returned on first call to finish(). Subsequent calls will return a clone of the original error (if the operation failed) or an AlreadyFinished error (if the operation succeeded).

Implementations§

Source§

impl<T, E: Clone> EagerOpRef<T, E>

Source

pub fn ok(id: OpId, value: T) -> Self

Source

pub fn err(id: OpId, error: E) -> Self

Trait Implementations§

Source§

impl<T, E: FinishableError> OpRef for EagerOpRef<T, E>

Source§

type Info = ()

Metadata describing the operation (e.g. query parameters, batch size).
Source§

type Stats = ()

Runtime statistics collected during the operation (e.g. distances computed, nodes visited).
Source§

type Result = T

The successful outcome of the operation.
Source§

type Error = E

The error type returned when the operation fails.
Source§

fn id(&self) -> &OpId

Returns the unique identifier assigned to this operation. Can represent some sort of ID for the entry in an eager operation context is up to the implementation (for example a entry tag for a local index)
Source§

fn info(&self) -> Option<Self::Info>

Returns metadata describing the operation. Read more
Source§

fn stats(&self) -> Option<Self::Stats>

Returns runtime statistics collected so far. Read more
Source§

fn is_finished(&self) -> bool

Returns true once the operation has completed (successfully or not). Read more
Source§

fn finish(&mut self) -> Result<Self::Result, Self::Error>

Consumes the pending operation and returns its result. Read more

Auto Trait Implementations§

§

impl<T, E> Freeze for EagerOpRef<T, E>
where E: Freeze, T: Freeze,

§

impl<T, E> RefUnwindSafe for EagerOpRef<T, E>

§

impl<T, E> Send for EagerOpRef<T, E>
where E: Send, T: Send,

§

impl<T, E> Sync for EagerOpRef<T, E>
where E: Sync, T: Sync,

§

impl<T, E> Unpin for EagerOpRef<T, E>
where E: Unpin, T: Unpin,

§

impl<T, E> UnsafeUnpin for EagerOpRef<T, E>
where E: UnsafeUnpin, T: UnsafeUnpin,

§

impl<T, E> UnwindSafe for EagerOpRef<T, E>
where E: UnwindSafe, T: UnwindSafe,

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V