pub struct DataResolver { /* private fields */ }
Expand description
Clients interact with this struct for data resolution operations.
In particular, this forms an important part of the juniper::Context
generated by the procedural macros. Essentially this holds a PathBuf
pointing at the data root directory, and exposes a get method for
trying to resolve a generic type at a specified data address under
that root directory.
Implementations§
Source§impl DataResolver
impl DataResolver
Sourcepub fn get<T>(&self, address: &[&str]) -> Result<T, DataResolverError>where
T: for<'de> Deserialize<'de> + ResolveValue,
pub fn get<T>(&self, address: &[&str]) -> Result<T, DataResolverError>where
T: for<'de> Deserialize<'de> + ResolveValue,
Try to retrieve an instance of a type at a specified address under the data root directory.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DataResolver
impl RefUnwindSafe for DataResolver
impl Send for DataResolver
impl Sync for DataResolver
impl Unpin for DataResolver
impl UnwindSafe for DataResolver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more