pub trait LoadFrom<T, Args = ()>: Sized {
type Error;
type Context;
// Required method
fn load(
ids: &[T],
args: &Args,
context: &Self::Context,
) -> Result<Vec<Self>, Self::Error>;
}
Expand description
How should associated values actually be loaded?
Normally T
will be your id type but for HasMany
and HasManyThrough
it might also
be other values.
If you’re using Diesel it is recommend that you use one of the macros to generate implementations.
Args
is the type of arguments your GraphQL field takes. This is how we’re able to load things
differently depending the types of arguments. You can learn more
here.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.