pub struct AdapterTap<'vertex, AdapterT>where
    AdapterT: Adapter<'vertex>,
    AdapterT::Vertex: Clone + Debug + PartialEq + Eq + Serialize + DeserializeOwned + 'vertex,{ /* private fields */ }
Expand description

An adapter “middleware” that records all adapter operations into a linear, replayable trace.

Tapping adapters must be done at top level, on the top-level adapter which is being used for query execution i.e. where the <V> generic on the resolver methods is the same as AdapterT::Vertex.

Otherwise, the recorded traces may not be possible to replay since they would be incomplete: they would only capture a portion of the execution, the rest of which is missing.

Implementations§

source§

impl<'vertex, AdapterT> AdapterTap<'vertex, AdapterT>where AdapterT: Adapter<'vertex>, AdapterT::Vertex: Clone + Debug + PartialEq + Eq + Serialize + DeserializeOwned + 'vertex,

source

pub fn new( adapter: AdapterT, tracer: Rc<RefCell<Trace<AdapterT::Vertex>>> ) -> Self

source

pub fn finish(self) -> Trace<AdapterT::Vertex>

Trait Implementations§

source§

impl<'vertex, AdapterT> Adapter<'vertex> for AdapterTap<'vertex, AdapterT>where AdapterT: Adapter<'vertex>, AdapterT::Vertex: Clone + Debug + PartialEq + Eq + Serialize + DeserializeOwned + 'vertex,

§

type Vertex = <AdapterT as Adapter<'vertex>>::Vertex

The type of vertices in the dataset this adapter queries. Unless your intended vertex type is cheap to clone, consider wrapping it an Rc or Arc to make cloning it cheaper since that’s a fairly common operation when queries are evaluated.
source§

fn resolve_starting_vertices( &self, edge_name: &Arc<str>, parameters: &EdgeParameters, resolve_info: &ResolveInfo ) -> VertexIterator<'vertex, Self::Vertex>

Produce an iterator of vertices for the specified starting edge. Read more
source§

fn resolve_property<V: AsVertex<Self::Vertex> + 'vertex>( &self, contexts: ContextIterator<'vertex, V>, type_name: &Arc<str>, property_name: &Arc<str>, resolve_info: &ResolveInfo ) -> ContextOutcomeIterator<'vertex, V, FieldValue>

Resolve a property required by the query that’s being evaluated. Read more
source§

fn resolve_neighbors<V: AsVertex<Self::Vertex> + 'vertex>( &self, contexts: ContextIterator<'vertex, V>, type_name: &Arc<str>, edge_name: &Arc<str>, parameters: &EdgeParameters, resolve_info: &ResolveEdgeInfo ) -> ContextOutcomeIterator<'vertex, V, VertexIterator<'vertex, Self::Vertex>>

Resolve the neighboring vertices across an edge. Read more
source§

fn resolve_coercion<V: AsVertex<Self::Vertex> + 'vertex>( &self, contexts: ContextIterator<'vertex, V>, type_name: &Arc<str>, coerce_to_type: &Arc<str>, resolve_info: &ResolveInfo ) -> ContextOutcomeIterator<'vertex, V, bool>

Attempt to coerce vertices to a subtype, as required by the query that’s being evaluated. Read more
source§

impl<'vertex, AdapterT> Clone for AdapterTap<'vertex, AdapterT>where AdapterT: Adapter<'vertex> + Clone, AdapterT::Vertex: Clone + Debug + PartialEq + Eq + Serialize + DeserializeOwned + 'vertex + Clone,

source§

fn clone(&self) -> AdapterTap<'vertex, AdapterT>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'vertex, AdapterT> Debug for AdapterTap<'vertex, AdapterT>where AdapterT: Adapter<'vertex> + Debug, AdapterT::Vertex: Clone + Debug + PartialEq + Eq + Serialize + DeserializeOwned + 'vertex + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'vertex, AdapterT> !RefUnwindSafe for AdapterTap<'vertex, AdapterT>

§

impl<'vertex, AdapterT> !Send for AdapterTap<'vertex, AdapterT>

§

impl<'vertex, AdapterT> !Sync for AdapterTap<'vertex, AdapterT>

§

impl<'vertex, AdapterT> Unpin for AdapterTap<'vertex, AdapterT>where AdapterT: Unpin,

§

impl<'vertex, AdapterT> !UnwindSafe for AdapterTap<'vertex, AdapterT>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<V> AsVertex<V> for Vwhere V: Debug + Clone,

source§

fn as_vertex(&self) -> Option<&V>

Dereference this value into a &V, if the value happens to contain a V. Read more
source§

fn into_vertex(self) -> Option<V>

Consume self and produce the contained V, if one was indeed present. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.