Struct artemis_normalized_cache::QueryStore[][src]

pub struct QueryStore { /* fields omitted */ }

A reference to the store used to run custom query updates

Implementations

impl QueryStore[src]

pub fn update_query<'a, Q: GraphQLQuery, F>(
    &'a self,
    _query: Q,
    variables: Q::Variables,
    updater_fn: F,
    dependencies: &mut HashSet<String>
) where
    F: FnOnce(Option<Q::ResponseData>) -> Option<Q::ResponseData> + 'a, 
[src]

Run a custom update function against the cache.

Parameters

  • _query - The GraphQLQuery object for the query you want to update.
  • variables - The Variables for the query you want to update. It will only update cached results for that set of variables.
  • updater_fn - The custom updater function. This takes in an Option<ResponseData> that represents the current state and should return an Option<ResponseData> that represents the new state. None means deleting the entry in this context. The current state is cloned, so feel free to modify and return it.
  • dependencies - This is passed into the update closure and should simply be passed through.

Trait Implementations

impl Clone for QueryStore[src]

impl From<Arc<Store>> for QueryStore[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.