Skip to main content

Scope

Struct Scope 

Source
pub struct Scope<'a, S: Source, W: Work> { /* private fields */ }
Expand description

The query of a Source that has no access guard of its own.

No clone, allocation or reference-count increment is needed to construct it.

Implementations§

Source§

impl<'a, S: Source, W: Work> Scope<'a, S, W>

Source

pub fn new( source: &'a S, snapshot: Snapshot<S::Document, S::Generation>, execution: &'a W, ) -> Self

Attaches the expected original snapshot and current operation.

Trait Implementations§

Source§

impl<S: Source, W: Work> Query for Scope<'_, S, W>

Source§

type Id = <S as Source>::Id

Original node identity.
Source§

type Document = <S as Source>::Document

Stable document identity.
Source§

type Generation = <S as Source>::Generation

Exact document generation.
Source§

type Work = W

Current execution funding this query.
Source§

fn snapshot(&self) -> Snapshot<S::Document, S::Generation>

The expected source snapshot of every fact checked in this query.
Source§

fn execution(&self) -> &W

The current execution; storage and work for results are admitted here.
Source§

fn admit(&self, node: S::Id, units: u64) -> Result<(), ScopeError<S::Id>>

Requires the live source at the expected snapshot, admits units of work, and requires the snapshot again.
Source§

fn equal(&self, left: Self::Id, right: Self::Id) -> Result<bool, MemoryError>

Compares two identities after admitting their complete HashWork.

Auto Trait Implementations§

§

impl<'a, S, W> Freeze for Scope<'a, S, W>

§

impl<'a, S, W> RefUnwindSafe for Scope<'a, S, W>

§

impl<'a, S, W> Send for Scope<'a, S, W>

§

impl<'a, S, W> Sync for Scope<'a, S, W>

§

impl<'a, S, W> Unpin for Scope<'a, S, W>

§

impl<'a, S, W> UnsafeUnpin for Scope<'a, S, W>

§

impl<'a, S, W> UnwindSafe for Scope<'a, S, W>

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.