Re-impl renewed traits machinery for other pointer types
This commit is contained in:
parent
017e87c791
commit
5ab398e22b
8 changed files with 619 additions and 557 deletions
|
@ -2,10 +2,10 @@ use crate::{behavior, resolve};
|
|||
|
||||
pub use crate::{
|
||||
ast::InputValue,
|
||||
executor::Variables,
|
||||
macros::{input_value, value, vars},
|
||||
resolve::Type,
|
||||
value::Value,
|
||||
executor::Variables,
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -47,6 +47,21 @@ pub trait Scalar<
|
|||
fn assert_scalar();
|
||||
}
|
||||
|
||||
pub trait ScalarAs<
|
||||
'inp,
|
||||
Wrapper,
|
||||
TypeInfo: ?Sized,
|
||||
Context: ?Sized,
|
||||
ScalarValue: 'inp,
|
||||
Behavior: ?Sized = behavior::Standard,
|
||||
>:
|
||||
InputTypeAs<'inp, Wrapper, TypeInfo, ScalarValue, Behavior>
|
||||
+ OutputType<TypeInfo, Context, ScalarValue, Behavior>
|
||||
+ resolve::ScalarToken<ScalarValue, Behavior>
|
||||
{
|
||||
fn assert_scalar();
|
||||
}
|
||||
|
||||
/*
|
||||
pub trait Union<S>
|
||||
OutputType<S>
|
||||
|
@ -73,6 +88,20 @@ pub trait InputType<
|
|||
fn assert_input_type();
|
||||
}
|
||||
|
||||
pub trait InputTypeAs<
|
||||
'inp,
|
||||
Wrapper,
|
||||
TypeInfo: ?Sized,
|
||||
ScalarValue: 'inp,
|
||||
Behavior: ?Sized = behavior::Standard,
|
||||
>:
|
||||
Type<TypeInfo, ScalarValue, Behavior>
|
||||
+ resolve::ToInputValue<ScalarValue, Behavior>
|
||||
+ resolve::InputValueAs<'inp, Wrapper, ScalarValue, Behavior>
|
||||
{
|
||||
fn assert_input_type();
|
||||
}
|
||||
|
||||
pub trait OutputType<
|
||||
TypeInfo: ?Sized,
|
||||
Context: ?Sized,
|
||||
|
|
|
@ -5,12 +5,6 @@ use crate::{
|
|||
reflect, Arguments, BoxFuture, ExecutionResult, Executor, IntoFieldError, Registry, Selection,
|
||||
};
|
||||
|
||||
#[doc(inline)]
|
||||
pub use crate::types::{
|
||||
/*arc::TryFromInputValue as InputValueAsArc,*/ r#box::TryFromInputValue as InputValueAsBox,
|
||||
/*r#ref::TryFromInputValue as InputValueAsRef, rc::TryFromInputValue as InputValueAsRc,*/
|
||||
};
|
||||
|
||||
pub trait Type<TypeInfo: ?Sized, ScalarValue, Behavior: ?Sized = behavior::Standard> {
|
||||
fn meta<'r>(
|
||||
registry: &mut Registry<'r, ScalarValue>,
|
||||
|
@ -179,6 +173,32 @@ pub trait InputValueOwned<ScalarValue, Behavior: ?Sized = behavior::Standard>:
|
|||
|
||||
impl<T, SV, BH: ?Sized> InputValueOwned<SV, BH> for T where T: for<'i> InputValue<'i, SV, BH> {}
|
||||
|
||||
pub trait InputValueAs<'input, Wrapper, ScalarValue: 'input, Behavior: ?Sized = behavior::Standard>
|
||||
{
|
||||
type Error: IntoFieldError<ScalarValue>;
|
||||
|
||||
fn try_from_input_value(
|
||||
v: &'input graphql::InputValue<ScalarValue>,
|
||||
) -> Result<Wrapper, Self::Error>;
|
||||
|
||||
fn try_from_implicit_null() -> Result<Wrapper, Self::Error> {
|
||||
Self::try_from_input_value(&graphql::InputValue::<ScalarValue>::Null)
|
||||
}
|
||||
}
|
||||
|
||||
pub trait InputValueAsRef<ScalarValue, Behavior: ?Sized = behavior::Standard> {
|
||||
type Error: IntoFieldError<ScalarValue>;
|
||||
|
||||
fn try_from_input_value(v: &graphql::InputValue<ScalarValue>) -> Result<&Self, Self::Error>;
|
||||
|
||||
fn try_from_implicit_null<'a>() -> Result<&'a Self, Self::Error>
|
||||
where
|
||||
ScalarValue: 'a,
|
||||
{
|
||||
Self::try_from_input_value(&graphql::InputValue::<ScalarValue>::Null)
|
||||
}
|
||||
}
|
||||
|
||||
pub trait ScalarToken<ScalarValue, Behavior: ?Sized = behavior::Standard> {
|
||||
fn parse_scalar_token(token: parser::ScalarToken<'_>) -> Result<ScalarValue, ParseError<'_>>;
|
||||
}
|
||||
|
|
|
@ -6,277 +6,287 @@ use crate::{
|
|||
graphql,
|
||||
meta::MetaType,
|
||||
parser::{ParseError, ScalarToken},
|
||||
reflect, resolve, Arguments, BoxFuture, DefaultScalarValue, ExecutionResult, Executor,
|
||||
IntoFieldError, Registry, Selection,
|
||||
reflect, resolve, Arguments, BoxFuture, ExecutionResult, Executor, Registry, Selection,
|
||||
};
|
||||
|
||||
/*
|
||||
impl<T, Info, S> resolve::Type<Info, S> for Arc<T>
|
||||
impl<T, TI, SV, BH> resolve::Type<TI, SV, BH> for Arc<T>
|
||||
where
|
||||
T: resolve::Type<Info, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
T: resolve::Type<TI, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn meta<'r>(registry: &mut Registry<'r, S>, info: &Info) -> MetaType<'r, S>
|
||||
fn meta<'r>(registry: &mut Registry<'r, SV>, info: &TI) -> MetaType<'r, SV>
|
||||
where
|
||||
S: 'r,
|
||||
SV: 'r,
|
||||
{
|
||||
T::meta(registry, info)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, Info> resolve::TypeName<Info> for Arc<T>
|
||||
impl<T, TI, BH> resolve::TypeName<TI, BH> for Arc<T>
|
||||
where
|
||||
T: resolve::TypeName<Info> + ?Sized,
|
||||
Info: ?Sized,
|
||||
T: resolve::TypeName<TI, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn type_name(info: &Info) -> &str {
|
||||
fn type_name(info: &TI) -> &str {
|
||||
T::type_name(info)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, Info> resolve::ConcreteTypeName<Info> for Arc<T>
|
||||
impl<T, TI, BH> resolve::ConcreteTypeName<TI, BH> for Arc<T>
|
||||
where
|
||||
T: resolve::ConcreteTypeName<Info> + ?Sized,
|
||||
Info: ?Sized,
|
||||
T: resolve::ConcreteTypeName<TI, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn concrete_type_name<'i>(&self, info: &'i Info) -> &'i str {
|
||||
fn concrete_type_name<'i>(&self, info: &'i TI) -> &'i str {
|
||||
(**self).concrete_type_name(info)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, Info, Ctx, S> resolve::Value<Info, Ctx, S> for Arc<T>
|
||||
impl<T, TI, CX, SV, BH> resolve::Value<TI, CX, SV, BH> for Arc<T>
|
||||
where
|
||||
T: resolve::Value<Info, Ctx, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
Ctx: ?Sized,
|
||||
T: resolve::Value<TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn resolve_value(
|
||||
&self,
|
||||
selection_set: Option<&[Selection<'_, S>]>,
|
||||
info: &Info,
|
||||
executor: &Executor<Ctx, S>,
|
||||
) -> ExecutionResult<S> {
|
||||
(**self).resolve_value(selection_set, info, executor)
|
||||
selection_set: Option<&[Selection<'_, SV>]>,
|
||||
type_info: &TI,
|
||||
executor: &Executor<CX, SV>,
|
||||
) -> ExecutionResult<SV> {
|
||||
(**self).resolve_value(selection_set, type_info, executor)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, Info, Ctx, S> resolve::ValueAsync<Info, Ctx, S> for Arc<T>
|
||||
impl<T, TI, CX, SV, BH> resolve::ValueAsync<TI, CX, SV, BH> for Arc<T>
|
||||
where
|
||||
T: resolve::ValueAsync<Info, Ctx, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
Ctx: ?Sized,
|
||||
T: resolve::ValueAsync<TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn resolve_value_async<'r>(
|
||||
&'r self,
|
||||
selection_set: Option<&'r [Selection<'_, S>]>,
|
||||
info: &'r Info,
|
||||
executor: &'r Executor<Ctx, S>,
|
||||
) -> BoxFuture<'r, ExecutionResult<S>> {
|
||||
(**self).resolve_value_async(selection_set, info, executor)
|
||||
selection_set: Option<&'r [Selection<'_, SV>]>,
|
||||
type_info: &'r TI,
|
||||
executor: &'r Executor<CX, SV>,
|
||||
) -> BoxFuture<'r, ExecutionResult<SV>> {
|
||||
(**self).resolve_value_async(selection_set, type_info, executor)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, Info, Ctx, S> resolve::ConcreteValue<Info, Ctx, S> for Arc<T>
|
||||
impl<T, TI, CX, SV, BH> resolve::ConcreteValue<TI, CX, SV, BH> for Arc<T>
|
||||
where
|
||||
T: resolve::ConcreteValue<Info, Ctx, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
Ctx: ?Sized,
|
||||
T: resolve::ConcreteValue<TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn resolve_concrete_value(
|
||||
&self,
|
||||
type_name: &str,
|
||||
selection_set: Option<&[Selection<'_, S>]>,
|
||||
info: &Info,
|
||||
executor: &Executor<Ctx, S>,
|
||||
) -> ExecutionResult<S> {
|
||||
(**self).resolve_concrete_value(type_name, selection_set, info, executor)
|
||||
selection_set: Option<&[Selection<'_, SV>]>,
|
||||
type_info: &TI,
|
||||
executor: &Executor<CX, SV>,
|
||||
) -> ExecutionResult<SV> {
|
||||
(**self).resolve_concrete_value(type_name, selection_set, type_info, executor)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, Info, Ctx, S> resolve::ConcreteValueAsync<Info, Ctx, S> for Arc<T>
|
||||
impl<T, TI, CX, SV, BH> resolve::ConcreteValueAsync<TI, CX, SV, BH> for Arc<T>
|
||||
where
|
||||
T: resolve::ConcreteValueAsync<Info, Ctx, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
Ctx: ?Sized,
|
||||
T: resolve::ConcreteValueAsync<TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn resolve_concrete_value_async<'r>(
|
||||
&'r self,
|
||||
type_name: &str,
|
||||
selection_set: Option<&'r [Selection<'_, S>]>,
|
||||
info: &'r Info,
|
||||
executor: &'r Executor<Ctx, S>,
|
||||
) -> BoxFuture<'r, ExecutionResult<S>> {
|
||||
(**self).resolve_concrete_value_async(type_name, selection_set, info, executor)
|
||||
selection_set: Option<&'r [Selection<'_, SV>]>,
|
||||
type_info: &'r TI,
|
||||
executor: &'r Executor<CX, SV>,
|
||||
) -> BoxFuture<'r, ExecutionResult<SV>> {
|
||||
(**self).resolve_concrete_value_async(type_name, selection_set, type_info, executor)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, Info, Ctx, S> resolve::Field<Info, Ctx, S> for Arc<T>
|
||||
impl<T, TI, CX, SV, BH> resolve::Field<TI, CX, SV, BH> for Arc<T>
|
||||
where
|
||||
T: resolve::Field<Info, Ctx, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
Ctx: ?Sized,
|
||||
T: resolve::Field<TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn resolve_field(
|
||||
&self,
|
||||
field_name: &str,
|
||||
arguments: &Arguments<S>,
|
||||
info: &Info,
|
||||
executor: &Executor<Ctx, S>,
|
||||
) -> ExecutionResult<S> {
|
||||
(**self).resolve_field(field_name, arguments, info, executor)
|
||||
arguments: &Arguments<SV>,
|
||||
type_info: &TI,
|
||||
executor: &Executor<CX, SV>,
|
||||
) -> ExecutionResult<SV> {
|
||||
(**self).resolve_field(field_name, arguments, type_info, executor)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, Info, Ctx, S> resolve::FieldAsync<Info, Ctx, S> for Arc<T>
|
||||
impl<T, TI, CX, SV, BH> resolve::FieldAsync<TI, CX, SV, BH> for Arc<T>
|
||||
where
|
||||
T: resolve::FieldAsync<Info, Ctx, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
Ctx: ?Sized,
|
||||
T: resolve::FieldAsync<TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn resolve_field_async<'r>(
|
||||
&'r self,
|
||||
field_name: &'r str,
|
||||
arguments: &'r Arguments<S>,
|
||||
info: &'r Info,
|
||||
executor: &'r Executor<Ctx, S>,
|
||||
) -> BoxFuture<'r, ExecutionResult<S>> {
|
||||
(**self).resolve_field_async(field_name, arguments, info, executor)
|
||||
arguments: &'r Arguments<SV>,
|
||||
type_info: &'r TI,
|
||||
executor: &'r Executor<CX, SV>,
|
||||
) -> BoxFuture<'r, ExecutionResult<SV>> {
|
||||
(**self).resolve_field_async(field_name, arguments, type_info, executor)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, S> resolve::ToInputValue<S> for Arc<T>
|
||||
impl<T, SV, BH> resolve::ToInputValue<SV, BH> for Arc<T>
|
||||
where
|
||||
T: resolve::ToInputValue<S> + ?Sized,
|
||||
T: resolve::ToInputValue<SV, BH> + ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn to_input_value(&self) -> graphql::InputValue<S> {
|
||||
fn to_input_value(&self) -> graphql::InputValue<SV> {
|
||||
(**self).to_input_value()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'inp, T, S> resolve::InputValue<'inp, S> for Arc<T>
|
||||
impl<'i, T, SV, BH> resolve::InputValue<'i, SV, BH> for Arc<T>
|
||||
where
|
||||
T: resolve::InputValueAsArc<'inp, S> + ?Sized,
|
||||
S: 'inp,
|
||||
T: resolve::InputValueAs<'i, Self, SV, BH> + ?Sized,
|
||||
SV: 'i,
|
||||
BH: ?Sized,
|
||||
{
|
||||
type Error = <T as resolve::InputValueAsArc<'inp, S>>::Error;
|
||||
type Error = T::Error;
|
||||
|
||||
fn try_from_input_value(v: &'inp graphql::InputValue<S>) -> Result<Self, Self::Error> {
|
||||
<T as resolve::InputValueAsArc<'inp, S>>::try_from_input_value(v)
|
||||
fn try_from_input_value(v: &'i graphql::InputValue<SV>) -> Result<Self, Self::Error> {
|
||||
T::try_from_input_value(v)
|
||||
}
|
||||
|
||||
fn try_from_implicit_null() -> Result<Self, Self::Error> {
|
||||
<T as resolve::InputValueAsArc<'inp, S>>::try_from_implicit_null()
|
||||
T::try_from_implicit_null()
|
||||
}
|
||||
}
|
||||
|
||||
pub trait TryFromInputValue<'input, S: 'input = DefaultScalarValue> {
|
||||
type Error: IntoFieldError<S>;
|
||||
|
||||
fn try_from_input_value(v: &'input graphql::InputValue<S>) -> Result<Arc<Self>, Self::Error>;
|
||||
|
||||
fn try_from_implicit_null() -> Result<Arc<Self>, Self::Error> {
|
||||
Self::try_from_input_value(&graphql::InputValue::<S>::Null)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'inp, T, S> TryFromInputValue<'inp, S> for T
|
||||
impl<'i, T, SV, BH> resolve::InputValueAs<'i, Arc<T>, SV, BH> for T
|
||||
where
|
||||
T: resolve::InputValue<'inp, S>,
|
||||
S: 'inp,
|
||||
T: resolve::InputValue<'i, SV, BH>,
|
||||
SV: 'i,
|
||||
BH: ?Sized,
|
||||
{
|
||||
type Error = <T as resolve::InputValue<'inp, S>>::Error;
|
||||
type Error = T::Error;
|
||||
|
||||
fn try_from_input_value(v: &'inp graphql::InputValue<S>) -> Result<Arc<Self>, Self::Error> {
|
||||
<T as resolve::InputValue<'inp, S>>::try_from_input_value(v).map(Arc::new)
|
||||
fn try_from_input_value(v: &'i graphql::InputValue<SV>) -> Result<Arc<Self>, Self::Error> {
|
||||
T::try_from_input_value(v).map(Arc::new)
|
||||
}
|
||||
|
||||
fn try_from_implicit_null() -> Result<Arc<Self>, Self::Error> {
|
||||
<T as resolve::InputValue<'inp, S>>::try_from_implicit_null().map(Arc::new)
|
||||
T::try_from_implicit_null().map(Arc::new)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, S> resolve::ScalarToken<S> for Arc<T>
|
||||
impl<T, SV, BH> resolve::ScalarToken<SV, BH> for Arc<T>
|
||||
where
|
||||
T: resolve::ScalarToken<S> + ?Sized,
|
||||
T: resolve::ScalarToken<SV, BH> + ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn parse_scalar_token(token: ScalarToken<'_>) -> Result<S, ParseError<'_>> {
|
||||
fn parse_scalar_token(token: ScalarToken<'_>) -> Result<SV, ParseError<'_>> {
|
||||
T::parse_scalar_token(token)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'i, T, Info, S: 'i> graphql::InputType<'i, Info, S> for Arc<T>
|
||||
impl<'i, T, TI, SV, BH> graphql::InputType<'i, TI, SV, BH> for Arc<T>
|
||||
where
|
||||
T: graphql::InputType<'i, Info, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
T: graphql::InputTypeAs<'i, Self, TI, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
SV: 'i,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn assert_input_type() {
|
||||
T::assert_input_type()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, S> graphql::OutputType<S> for Arc<T>
|
||||
impl<'i, T, TI, SV, BH> graphql::InputTypeAs<'i, Arc<T>, TI, SV, BH> for T
|
||||
where
|
||||
T: graphql::OutputType<S> + ?Sized,
|
||||
T: graphql::InputType<'i, TI, SV, BH>,
|
||||
TI: ?Sized,
|
||||
SV: 'i,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn assert_input_type() {
|
||||
T::assert_input_type()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, TI, CX, SV, BH> graphql::OutputType<TI, CX, SV, BH> for Arc<T>
|
||||
where
|
||||
T: graphql::OutputType<TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn assert_output_type() {
|
||||
T::assert_output_type()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, S> graphql::Interface<S> for Arc<T>
|
||||
impl<'i, T, TI, CX, SV, BH> graphql::Scalar<'i, TI, CX, SV, BH> for Arc<T>
|
||||
where
|
||||
T: graphql::Interface<S> + ?Sized,
|
||||
{
|
||||
fn assert_interface() {
|
||||
T::assert_interface()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, S> graphql::Object<S> for Arc<T>
|
||||
where
|
||||
T: graphql::Object<S> + ?Sized,
|
||||
{
|
||||
fn assert_object() {
|
||||
T::assert_object()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, S> graphql::Scalar<S> for Arc<T>
|
||||
where
|
||||
T: graphql::Scalar<S> + ?Sized,
|
||||
T: graphql::ScalarAs<'i, Self, TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
SV: 'i,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn assert_scalar() {
|
||||
T::assert_scalar()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, S> graphql::Union<S> for Arc<T>
|
||||
impl<'i, T, TI, CX, SV, BH> graphql::ScalarAs<'i, Arc<T>, TI, CX, SV, BH> for T
|
||||
where
|
||||
T: graphql::Union<S> + ?Sized,
|
||||
T: graphql::Scalar<'i, TI, CX, SV, BH>,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
SV: 'i,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn assert_union() {
|
||||
T::assert_union()
|
||||
fn assert_scalar() {
|
||||
T::assert_scalar()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, S> reflect::BaseType<S> for Arc<T>
|
||||
impl<T, BH> reflect::BaseType<BH> for Arc<T>
|
||||
where
|
||||
T: reflect::BaseType<S> + ?Sized,
|
||||
T: reflect::BaseType<BH> + ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
const NAME: reflect::Type = T::NAME;
|
||||
}
|
||||
|
||||
impl<T, S> reflect::BaseSubTypes<S> for Arc<T>
|
||||
impl<T, BH> reflect::BaseSubTypes<BH> for Arc<T>
|
||||
where
|
||||
T: reflect::BaseSubTypes<S> + ?Sized,
|
||||
T: reflect::BaseSubTypes<BH> + ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
const NAMES: reflect::Types = T::NAMES;
|
||||
}
|
||||
|
||||
impl<T, S> reflect::WrappedType<S> for Arc<T>
|
||||
impl<T, BH> reflect::WrappedType<BH> for Arc<T>
|
||||
where
|
||||
T: reflect::WrappedType<S> + ?Sized,
|
||||
T: reflect::WrappedType<BH> + ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
const VALUE: reflect::WrappedValue = T::VALUE;
|
||||
}
|
||||
*/
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
//! GraphQL implementation for [`Box`].
|
||||
|
||||
use crate::{
|
||||
behavior, graphql,
|
||||
graphql,
|
||||
meta::MetaType,
|
||||
parser::{ParseError, ScalarToken},
|
||||
reflect, resolve, Arguments, BoxFuture, ExecutionResult, Executor, IntoFieldError, Registry,
|
||||
Selection,
|
||||
reflect, resolve, Arguments, BoxFuture, ExecutionResult, Executor, Registry, Selection,
|
||||
};
|
||||
|
||||
impl<T, TI, SV, BH> resolve::Type<TI, SV, BH> for Box<T>
|
||||
|
@ -162,7 +161,7 @@ where
|
|||
|
||||
impl<'i, T, SV, BH> resolve::InputValue<'i, SV, BH> for Box<T>
|
||||
where
|
||||
T: resolve::InputValueAsBox<'i, SV, BH> + ?Sized,
|
||||
T: resolve::InputValueAs<'i, Self, SV, BH> + ?Sized,
|
||||
SV: 'i,
|
||||
BH: ?Sized,
|
||||
{
|
||||
|
@ -177,19 +176,7 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
pub trait TryFromInputValue<'input, ScalarValue: 'input, Behavior: ?Sized = behavior::Standard> {
|
||||
type Error: IntoFieldError<ScalarValue>;
|
||||
|
||||
fn try_from_input_value(
|
||||
v: &'input graphql::InputValue<ScalarValue>,
|
||||
) -> Result<Box<Self>, Self::Error>;
|
||||
|
||||
fn try_from_implicit_null() -> Result<Box<Self>, Self::Error> {
|
||||
Self::try_from_input_value(&graphql::InputValue::<ScalarValue>::Null)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'i, T, SV, BH> TryFromInputValue<'i, SV, BH> for T
|
||||
impl<'i, T, SV, BH> resolve::InputValueAs<'i, Box<T>, SV, BH> for T
|
||||
where
|
||||
T: resolve::InputValue<'i, SV, BH>,
|
||||
SV: 'i,
|
||||
|
@ -217,6 +204,18 @@ where
|
|||
}
|
||||
|
||||
impl<'i, T, TI, SV, BH> graphql::InputType<'i, TI, SV, BH> for Box<T>
|
||||
where
|
||||
T: graphql::InputTypeAs<'i, Self, TI, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
SV: 'i,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn assert_input_type() {
|
||||
T::assert_input_type()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'i, T, TI, SV, BH> graphql::InputTypeAs<'i, Box<T>, TI, SV, BH> for T
|
||||
where
|
||||
T: graphql::InputType<'i, TI, SV, BH>,
|
||||
TI: ?Sized,
|
||||
|
@ -241,6 +240,19 @@ where
|
|||
}
|
||||
|
||||
impl<'i, T, TI, CX, SV, BH> graphql::Scalar<'i, TI, CX, SV, BH> for Box<T>
|
||||
where
|
||||
T: graphql::ScalarAs<'i, Self, TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
SV: 'i,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn assert_scalar() {
|
||||
T::assert_scalar()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'i, T, TI, CX, SV, BH> graphql::ScalarAs<'i, Box<T>, TI, CX, SV, BH> for T
|
||||
where
|
||||
T: graphql::Scalar<'i, TI, CX, SV, BH>,
|
||||
TI: ?Sized,
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
pub mod arc;
|
||||
mod arc;
|
||||
mod array;
|
||||
pub mod r#box;
|
||||
mod r#box;
|
||||
pub mod iter;
|
||||
mod nullable;
|
||||
mod option;
|
||||
pub mod rc;
|
||||
pub mod r#ref;
|
||||
mod rc;
|
||||
mod r#ref;
|
||||
mod ref_mut;
|
||||
mod result;
|
||||
mod slice;
|
||||
|
|
|
@ -6,277 +6,287 @@ use crate::{
|
|||
graphql,
|
||||
meta::MetaType,
|
||||
parser::{ParseError, ScalarToken},
|
||||
reflect, resolve, Arguments, BoxFuture, DefaultScalarValue, ExecutionResult, Executor,
|
||||
IntoFieldError, Registry, Selection,
|
||||
reflect, resolve, Arguments, BoxFuture, ExecutionResult, Executor, Registry, Selection,
|
||||
};
|
||||
|
||||
/*
|
||||
impl<T, Info, S> resolve::Type<Info, S> for Rc<T>
|
||||
impl<T, TI, SV, BH> resolve::Type<TI, SV, BH> for Rc<T>
|
||||
where
|
||||
T: resolve::Type<Info, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
T: resolve::Type<TI, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn meta<'r>(registry: &mut Registry<'r, S>, info: &Info) -> MetaType<'r, S>
|
||||
fn meta<'r>(registry: &mut Registry<'r, SV>, info: &TI) -> MetaType<'r, SV>
|
||||
where
|
||||
S: 'r,
|
||||
SV: 'r,
|
||||
{
|
||||
T::meta(registry, info)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, Info> resolve::TypeName<Info> for Rc<T>
|
||||
impl<T, TI, BH> resolve::TypeName<TI, BH> for Rc<T>
|
||||
where
|
||||
T: resolve::TypeName<Info> + ?Sized,
|
||||
Info: ?Sized,
|
||||
T: resolve::TypeName<TI, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn type_name(info: &Info) -> &str {
|
||||
fn type_name(info: &TI) -> &str {
|
||||
T::type_name(info)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, Info> resolve::ConcreteTypeName<Info> for Rc<T>
|
||||
impl<T, TI, BH> resolve::ConcreteTypeName<TI, BH> for Rc<T>
|
||||
where
|
||||
T: resolve::ConcreteTypeName<Info> + ?Sized,
|
||||
Info: ?Sized,
|
||||
T: resolve::ConcreteTypeName<TI, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn concrete_type_name<'i>(&self, info: &'i Info) -> &'i str {
|
||||
fn concrete_type_name<'i>(&self, info: &'i TI) -> &'i str {
|
||||
(**self).concrete_type_name(info)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, Info, Ctx, S> resolve::Value<Info, Ctx, S> for Rc<T>
|
||||
impl<T, TI, CX, SV, BH> resolve::Value<TI, CX, SV, BH> for Rc<T>
|
||||
where
|
||||
T: resolve::Value<Info, Ctx, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
Ctx: ?Sized,
|
||||
T: resolve::Value<TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn resolve_value(
|
||||
&self,
|
||||
selection_set: Option<&[Selection<'_, S>]>,
|
||||
info: &Info,
|
||||
executor: &Executor<Ctx, S>,
|
||||
) -> ExecutionResult<S> {
|
||||
(**self).resolve_value(selection_set, info, executor)
|
||||
selection_set: Option<&[Selection<'_, SV>]>,
|
||||
type_info: &TI,
|
||||
executor: &Executor<CX, SV>,
|
||||
) -> ExecutionResult<SV> {
|
||||
(**self).resolve_value(selection_set, type_info, executor)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, Info, Ctx, S> resolve::ValueAsync<Info, Ctx, S> for Rc<T>
|
||||
impl<T, TI, CX, SV, BH> resolve::ValueAsync<TI, CX, SV, BH> for Rc<T>
|
||||
where
|
||||
T: resolve::ValueAsync<Info, Ctx, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
Ctx: ?Sized,
|
||||
T: resolve::ValueAsync<TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn resolve_value_async<'r>(
|
||||
&'r self,
|
||||
selection_set: Option<&'r [Selection<'_, S>]>,
|
||||
info: &'r Info,
|
||||
executor: &'r Executor<Ctx, S>,
|
||||
) -> BoxFuture<'r, ExecutionResult<S>> {
|
||||
(**self).resolve_value_async(selection_set, info, executor)
|
||||
selection_set: Option<&'r [Selection<'_, SV>]>,
|
||||
type_info: &'r TI,
|
||||
executor: &'r Executor<CX, SV>,
|
||||
) -> BoxFuture<'r, ExecutionResult<SV>> {
|
||||
(**self).resolve_value_async(selection_set, type_info, executor)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, Info, Ctx, S> resolve::ConcreteValue<Info, Ctx, S> for Rc<T>
|
||||
impl<T, TI, CX, SV, BH> resolve::ConcreteValue<TI, CX, SV, BH> for Rc<T>
|
||||
where
|
||||
T: resolve::ConcreteValue<Info, Ctx, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
Ctx: ?Sized,
|
||||
T: resolve::ConcreteValue<TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn resolve_concrete_value(
|
||||
&self,
|
||||
type_name: &str,
|
||||
selection_set: Option<&[Selection<'_, S>]>,
|
||||
info: &Info,
|
||||
executor: &Executor<Ctx, S>,
|
||||
) -> ExecutionResult<S> {
|
||||
(**self).resolve_concrete_value(type_name, selection_set, info, executor)
|
||||
selection_set: Option<&[Selection<'_, SV>]>,
|
||||
type_info: &TI,
|
||||
executor: &Executor<CX, SV>,
|
||||
) -> ExecutionResult<SV> {
|
||||
(**self).resolve_concrete_value(type_name, selection_set, type_info, executor)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, Info, Ctx, S> resolve::ConcreteValueAsync<Info, Ctx, S> for Rc<T>
|
||||
impl<T, TI, CX, SV, BH> resolve::ConcreteValueAsync<TI, CX, SV, BH> for Rc<T>
|
||||
where
|
||||
T: resolve::ConcreteValueAsync<Info, Ctx, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
Ctx: ?Sized,
|
||||
T: resolve::ConcreteValueAsync<TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn resolve_concrete_value_async<'r>(
|
||||
&'r self,
|
||||
type_name: &str,
|
||||
selection_set: Option<&'r [Selection<'_, S>]>,
|
||||
info: &'r Info,
|
||||
executor: &'r Executor<Ctx, S>,
|
||||
) -> BoxFuture<'r, ExecutionResult<S>> {
|
||||
(**self).resolve_concrete_value_async(type_name, selection_set, info, executor)
|
||||
selection_set: Option<&'r [Selection<'_, SV>]>,
|
||||
type_info: &'r TI,
|
||||
executor: &'r Executor<CX, SV>,
|
||||
) -> BoxFuture<'r, ExecutionResult<SV>> {
|
||||
(**self).resolve_concrete_value_async(type_name, selection_set, type_info, executor)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, Info, Ctx, S> resolve::Field<Info, Ctx, S> for Rc<T>
|
||||
impl<T, TI, CX, SV, BH> resolve::Field<TI, CX, SV, BH> for Rc<T>
|
||||
where
|
||||
T: resolve::Field<Info, Ctx, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
Ctx: ?Sized,
|
||||
T: resolve::Field<TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn resolve_field(
|
||||
&self,
|
||||
field_name: &str,
|
||||
arguments: &Arguments<S>,
|
||||
info: &Info,
|
||||
executor: &Executor<Ctx, S>,
|
||||
) -> ExecutionResult<S> {
|
||||
(**self).resolve_field(field_name, arguments, info, executor)
|
||||
arguments: &Arguments<SV>,
|
||||
type_info: &TI,
|
||||
executor: &Executor<CX, SV>,
|
||||
) -> ExecutionResult<SV> {
|
||||
(**self).resolve_field(field_name, arguments, type_info, executor)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, Info, Ctx, S> resolve::FieldAsync<Info, Ctx, S> for Rc<T>
|
||||
impl<T, TI, CX, SV, BH> resolve::FieldAsync<TI, CX, SV, BH> for Rc<T>
|
||||
where
|
||||
T: resolve::FieldAsync<Info, Ctx, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
Ctx: ?Sized,
|
||||
T: resolve::FieldAsync<TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn resolve_field_async<'r>(
|
||||
&'r self,
|
||||
field_name: &'r str,
|
||||
arguments: &'r Arguments<S>,
|
||||
info: &'r Info,
|
||||
executor: &'r Executor<Ctx, S>,
|
||||
) -> BoxFuture<'r, ExecutionResult<S>> {
|
||||
(**self).resolve_field_async(field_name, arguments, info, executor)
|
||||
arguments: &'r Arguments<SV>,
|
||||
type_info: &'r TI,
|
||||
executor: &'r Executor<CX, SV>,
|
||||
) -> BoxFuture<'r, ExecutionResult<SV>> {
|
||||
(**self).resolve_field_async(field_name, arguments, type_info, executor)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, S> resolve::ToInputValue<S> for Rc<T>
|
||||
impl<T, SV, BH> resolve::ToInputValue<SV, BH> for Rc<T>
|
||||
where
|
||||
T: resolve::ToInputValue<S> + ?Sized,
|
||||
T: resolve::ToInputValue<SV, BH> + ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn to_input_value(&self) -> graphql::InputValue<S> {
|
||||
fn to_input_value(&self) -> graphql::InputValue<SV> {
|
||||
(**self).to_input_value()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'inp, T, S> resolve::InputValue<'inp, S> for Rc<T>
|
||||
impl<'i, T, SV, BH> resolve::InputValue<'i, SV, BH> for Rc<T>
|
||||
where
|
||||
T: resolve::InputValueAsRc<'inp, S> + ?Sized,
|
||||
S: 'inp,
|
||||
T: resolve::InputValueAs<'i, Self, SV, BH> + ?Sized,
|
||||
SV: 'i,
|
||||
BH: ?Sized,
|
||||
{
|
||||
type Error = <T as resolve::InputValueAsRc<'inp, S>>::Error;
|
||||
type Error = T::Error;
|
||||
|
||||
fn try_from_input_value(v: &'inp graphql::InputValue<S>) -> Result<Self, Self::Error> {
|
||||
<T as resolve::InputValueAsRc<'inp, S>>::try_from_input_value(v)
|
||||
fn try_from_input_value(v: &'i graphql::InputValue<SV>) -> Result<Self, Self::Error> {
|
||||
T::try_from_input_value(v)
|
||||
}
|
||||
|
||||
fn try_from_implicit_null() -> Result<Self, Self::Error> {
|
||||
<T as resolve::InputValueAsRc<'inp, S>>::try_from_implicit_null()
|
||||
T::try_from_implicit_null()
|
||||
}
|
||||
}
|
||||
|
||||
pub trait TryFromInputValue<'input, S: 'input = DefaultScalarValue> {
|
||||
type Error: IntoFieldError<S>;
|
||||
|
||||
fn try_from_input_value(v: &'input graphql::InputValue<S>) -> Result<Rc<Self>, Self::Error>;
|
||||
|
||||
fn try_from_implicit_null() -> Result<Rc<Self>, Self::Error> {
|
||||
Self::try_from_input_value(&graphql::InputValue::<S>::Null)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'inp, T, S> TryFromInputValue<'inp, S> for T
|
||||
impl<'i, T, SV, BH> resolve::InputValueAs<'i, Rc<T>, SV, BH> for T
|
||||
where
|
||||
T: resolve::InputValue<'inp, S>,
|
||||
S: 'inp,
|
||||
T: resolve::InputValue<'i, SV, BH>,
|
||||
SV: 'i,
|
||||
BH: ?Sized,
|
||||
{
|
||||
type Error = <T as resolve::InputValue<'inp, S>>::Error;
|
||||
type Error = T::Error;
|
||||
|
||||
fn try_from_input_value(v: &'inp graphql::InputValue<S>) -> Result<Rc<Self>, Self::Error> {
|
||||
<T as resolve::InputValue<'inp, S>>::try_from_input_value(v).map(Rc::new)
|
||||
fn try_from_input_value(v: &'i graphql::InputValue<SV>) -> Result<Rc<Self>, Self::Error> {
|
||||
T::try_from_input_value(v).map(Rc::new)
|
||||
}
|
||||
|
||||
fn try_from_implicit_null() -> Result<Rc<Self>, Self::Error> {
|
||||
<T as resolve::InputValue<'inp, S>>::try_from_implicit_null().map(Rc::new)
|
||||
T::try_from_implicit_null().map(Rc::new)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, S> resolve::ScalarToken<S> for Rc<T>
|
||||
impl<T, SV, BH> resolve::ScalarToken<SV, BH> for Rc<T>
|
||||
where
|
||||
T: resolve::ScalarToken<S> + ?Sized,
|
||||
T: resolve::ScalarToken<SV, BH> + ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn parse_scalar_token(token: ScalarToken<'_>) -> Result<S, ParseError<'_>> {
|
||||
fn parse_scalar_token(token: ScalarToken<'_>) -> Result<SV, ParseError<'_>> {
|
||||
T::parse_scalar_token(token)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'i, T, Info, S: 'i> graphql::InputType<'i, Info, S> for Rc<T>
|
||||
impl<'i, T, TI, SV, BH> graphql::InputType<'i, TI, SV, BH> for Rc<T>
|
||||
where
|
||||
T: graphql::InputType<'i, Info, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
T: graphql::InputTypeAs<'i, Self, TI, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
SV: 'i,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn assert_input_type() {
|
||||
T::assert_input_type()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, S> graphql::OutputType<S> for Rc<T>
|
||||
impl<'i, T, TI, SV, BH> graphql::InputTypeAs<'i, Rc<T>, TI, SV, BH> for T
|
||||
where
|
||||
T: graphql::OutputType<S> + ?Sized,
|
||||
T: graphql::InputType<'i, TI, SV, BH>,
|
||||
TI: ?Sized,
|
||||
SV: 'i,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn assert_input_type() {
|
||||
T::assert_input_type()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, TI, CX, SV, BH> graphql::OutputType<TI, CX, SV, BH> for Rc<T>
|
||||
where
|
||||
T: graphql::OutputType<TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn assert_output_type() {
|
||||
T::assert_output_type()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, S> graphql::Interface<S> for Rc<T>
|
||||
impl<'i, T, TI, CX, SV, BH> graphql::Scalar<'i, TI, CX, SV, BH> for Rc<T>
|
||||
where
|
||||
T: graphql::Interface<S> + ?Sized,
|
||||
{
|
||||
fn assert_interface() {
|
||||
T::assert_interface()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, S> graphql::Object<S> for Rc<T>
|
||||
where
|
||||
T: graphql::Object<S> + ?Sized,
|
||||
{
|
||||
fn assert_object() {
|
||||
T::assert_object()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, S> graphql::Scalar<S> for Rc<T>
|
||||
where
|
||||
T: graphql::Scalar<S> + ?Sized,
|
||||
T: graphql::ScalarAs<'i, Self, TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
SV: 'i,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn assert_scalar() {
|
||||
T::assert_scalar()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, S> graphql::Union<S> for Rc<T>
|
||||
impl<'i, T, TI, CX, SV, BH> graphql::ScalarAs<'i, Rc<T>, TI, CX, SV, BH> for T
|
||||
where
|
||||
T: graphql::Union<S> + ?Sized,
|
||||
T: graphql::Scalar<'i, TI, CX, SV, BH>,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
SV: 'i,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn assert_union() {
|
||||
T::assert_union()
|
||||
fn assert_scalar() {
|
||||
T::assert_scalar()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, S> reflect::BaseType<S> for Rc<T>
|
||||
impl<T, BH> reflect::BaseType<BH> for Rc<T>
|
||||
where
|
||||
T: reflect::BaseType<S> + ?Sized,
|
||||
T: reflect::BaseType<BH> + ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
const NAME: reflect::Type = T::NAME;
|
||||
}
|
||||
|
||||
impl<T, S> reflect::BaseSubTypes<S> for Rc<T>
|
||||
impl<T, BH> reflect::BaseSubTypes<BH> for Rc<T>
|
||||
where
|
||||
T: reflect::BaseSubTypes<S> + ?Sized,
|
||||
T: reflect::BaseSubTypes<BH> + ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
const NAMES: reflect::Types = T::NAMES;
|
||||
}
|
||||
|
||||
impl<T, S> reflect::WrappedType<S> for Rc<T>
|
||||
impl<T, BH> reflect::WrappedType<BH> for Rc<T>
|
||||
where
|
||||
T: reflect::WrappedType<S> + ?Sized,
|
||||
T: reflect::WrappedType<BH> + ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
const VALUE: reflect::WrappedValue = T::VALUE;
|
||||
}
|
||||
*/
|
||||
|
|
|
@ -6,264 +6,266 @@ use crate::{
|
|||
graphql,
|
||||
meta::MetaType,
|
||||
parser::{ParseError, ScalarToken},
|
||||
reflect, resolve, Arguments, BoxFuture, DefaultScalarValue, ExecutionResult, Executor,
|
||||
IntoFieldError, Registry, Selection,
|
||||
reflect, resolve, Arguments, BoxFuture, ExecutionResult, Executor, Registry, Selection,
|
||||
};
|
||||
|
||||
/*
|
||||
impl<'me, T, Info, S> resolve::Type<Info, S> for &'me T
|
||||
impl<'me, T, TI, SV, BH> resolve::Type<TI, SV, BH> for &'me T
|
||||
where
|
||||
T: resolve::Type<Info, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
T: resolve::Type<TI, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn meta<'r>(registry: &mut Registry<'r, S>, info: &Info) -> MetaType<'r, S>
|
||||
fn meta<'r>(registry: &mut Registry<'r, SV>, info: &TI) -> MetaType<'r, SV>
|
||||
where
|
||||
S: 'r,
|
||||
SV: 'r,
|
||||
{
|
||||
T::meta(registry, info)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, Info> resolve::TypeName<Info> for &'me T
|
||||
impl<'me, T, TI, BH> resolve::TypeName<TI, BH> for &'me T
|
||||
where
|
||||
T: resolve::TypeName<Info> + ?Sized,
|
||||
Info: ?Sized,
|
||||
T: resolve::TypeName<TI, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn type_name(info: &Info) -> &str {
|
||||
fn type_name(info: &TI) -> &str {
|
||||
T::type_name(info)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, Info> resolve::ConcreteTypeName<Info> for &'me T
|
||||
impl<'me, T, TI, BH> resolve::ConcreteTypeName<TI, BH> for &'me T
|
||||
where
|
||||
T: resolve::ConcreteTypeName<Info> + ?Sized,
|
||||
Info: ?Sized,
|
||||
T: resolve::ConcreteTypeName<TI, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn concrete_type_name<'i>(&self, info: &'i Info) -> &'i str {
|
||||
fn concrete_type_name<'i>(&self, info: &'i TI) -> &'i str {
|
||||
(**self).concrete_type_name(info)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, Info, Ctx, S> resolve::Value<Info, Ctx, S> for &'me T
|
||||
impl<'me, T, TI, CX, SV, BH> resolve::Value<TI, CX, SV, BH> for &'me T
|
||||
where
|
||||
T: resolve::Value<Info, Ctx, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
Ctx: ?Sized,
|
||||
T: resolve::Value<TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn resolve_value(
|
||||
&self,
|
||||
selection_set: Option<&[Selection<'_, S>]>,
|
||||
info: &Info,
|
||||
executor: &Executor<Ctx, S>,
|
||||
) -> ExecutionResult<S> {
|
||||
(**self).resolve_value(selection_set, info, executor)
|
||||
selection_set: Option<&[Selection<'_, SV>]>,
|
||||
type_info: &TI,
|
||||
executor: &Executor<CX, SV>,
|
||||
) -> ExecutionResult<SV> {
|
||||
(**self).resolve_value(selection_set, type_info, executor)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, Info, Ctx, S> resolve::ValueAsync<Info, Ctx, S> for &'me T
|
||||
impl<'me, T, TI, CX, SV, BH> resolve::ValueAsync<TI, CX, SV, BH> for &'me T
|
||||
where
|
||||
T: resolve::ValueAsync<Info, Ctx, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
Ctx: ?Sized,
|
||||
T: resolve::ValueAsync<TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn resolve_value_async<'r>(
|
||||
&'r self,
|
||||
selection_set: Option<&'r [Selection<'_, S>]>,
|
||||
info: &'r Info,
|
||||
executor: &'r Executor<Ctx, S>,
|
||||
) -> BoxFuture<'r, ExecutionResult<S>> {
|
||||
(**self).resolve_value_async(selection_set, info, executor)
|
||||
selection_set: Option<&'r [Selection<'_, SV>]>,
|
||||
type_info: &'r TI,
|
||||
executor: &'r Executor<CX, SV>,
|
||||
) -> BoxFuture<'r, ExecutionResult<SV>> {
|
||||
(**self).resolve_value_async(selection_set, type_info, executor)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, Info, Ctx, S> resolve::ConcreteValue<Info, Ctx, S> for &'me T
|
||||
impl<'me, T, TI, CX, SV, BH> resolve::ConcreteValue<TI, CX, SV, BH> for &'me T
|
||||
where
|
||||
T: resolve::ConcreteValue<Info, Ctx, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
Ctx: ?Sized,
|
||||
T: resolve::ConcreteValue<TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn resolve_concrete_value(
|
||||
&self,
|
||||
type_name: &str,
|
||||
selection_set: Option<&[Selection<'_, S>]>,
|
||||
info: &Info,
|
||||
executor: &Executor<Ctx, S>,
|
||||
) -> ExecutionResult<S> {
|
||||
(**self).resolve_concrete_value(type_name, selection_set, info, executor)
|
||||
selection_set: Option<&[Selection<'_, SV>]>,
|
||||
type_info: &TI,
|
||||
executor: &Executor<CX, SV>,
|
||||
) -> ExecutionResult<SV> {
|
||||
(**self).resolve_concrete_value(type_name, selection_set, type_info, executor)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, Info, Ctx, S> resolve::ConcreteValueAsync<Info, Ctx, S> for &'me T
|
||||
impl<'me, T, TI, CX, SV, BH> resolve::ConcreteValueAsync<TI, CX, SV, BH> for &'me T
|
||||
where
|
||||
T: resolve::ConcreteValueAsync<Info, Ctx, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
Ctx: ?Sized,
|
||||
T: resolve::ConcreteValueAsync<TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn resolve_concrete_value_async<'r>(
|
||||
&'r self,
|
||||
type_name: &str,
|
||||
selection_set: Option<&'r [Selection<'_, S>]>,
|
||||
info: &'r Info,
|
||||
executor: &'r Executor<Ctx, S>,
|
||||
) -> BoxFuture<'r, ExecutionResult<S>> {
|
||||
(**self).resolve_concrete_value_async(type_name, selection_set, info, executor)
|
||||
selection_set: Option<&'r [Selection<'_, SV>]>,
|
||||
type_info: &'r TI,
|
||||
executor: &'r Executor<CX, SV>,
|
||||
) -> BoxFuture<'r, ExecutionResult<SV>> {
|
||||
(**self).resolve_concrete_value_async(type_name, selection_set, type_info, executor)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, Info, Ctx, S> resolve::Field<Info, Ctx, S> for &'me T
|
||||
impl<'me, T, TI, CX, SV, BH> resolve::Field<TI, CX, SV, BH> for &'me T
|
||||
where
|
||||
T: resolve::Field<Info, Ctx, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
Ctx: ?Sized,
|
||||
T: resolve::Field<TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn resolve_field(
|
||||
&self,
|
||||
field_name: &str,
|
||||
arguments: &Arguments<S>,
|
||||
info: &Info,
|
||||
executor: &Executor<Ctx, S>,
|
||||
) -> ExecutionResult<S> {
|
||||
(**self).resolve_field(field_name, arguments, info, executor)
|
||||
arguments: &Arguments<SV>,
|
||||
type_info: &TI,
|
||||
executor: &Executor<CX, SV>,
|
||||
) -> ExecutionResult<SV> {
|
||||
(**self).resolve_field(field_name, arguments, type_info, executor)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, Info, Ctx, S> resolve::FieldAsync<Info, Ctx, S> for &'me T
|
||||
impl<'me, T, TI, CX, SV, BH> resolve::FieldAsync<TI, CX, SV, BH> for &'me T
|
||||
where
|
||||
T: resolve::FieldAsync<Info, Ctx, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
Ctx: ?Sized,
|
||||
T: resolve::FieldAsync<TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn resolve_field_async<'r>(
|
||||
&'r self,
|
||||
field_name: &'r str,
|
||||
arguments: &'r Arguments<S>,
|
||||
info: &'r Info,
|
||||
executor: &'r Executor<Ctx, S>,
|
||||
) -> BoxFuture<'r, ExecutionResult<S>> {
|
||||
(**self).resolve_field_async(field_name, arguments, info, executor)
|
||||
arguments: &'r Arguments<SV>,
|
||||
type_info: &'r TI,
|
||||
executor: &'r Executor<CX, SV>,
|
||||
) -> BoxFuture<'r, ExecutionResult<SV>> {
|
||||
(**self).resolve_field_async(field_name, arguments, type_info, executor)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, S> resolve::ToInputValue<S> for &'me T
|
||||
impl<'me, T, SV, BH> resolve::ToInputValue<SV, BH> for &'me T
|
||||
where
|
||||
T: resolve::ToInputValue<S> + ?Sized,
|
||||
T: resolve::ToInputValue<SV, BH> + ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn to_input_value(&self) -> graphql::InputValue<S> {
|
||||
fn to_input_value(&self) -> graphql::InputValue<SV> {
|
||||
(**self).to_input_value()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'inp: 'me, 'me, T, S: 'inp> resolve::InputValue<'inp, S> for &'me T
|
||||
impl<'me, 'i, T, SV, BH> resolve::InputValue<'i, SV, BH> for &'me T
|
||||
where
|
||||
T: resolve::InputValueAsRef<S> + ?Sized,
|
||||
'i: 'me,
|
||||
T: resolve::InputValueAs<'i, &'me T, SV, BH> + ?Sized,
|
||||
SV: 'i,
|
||||
BH: ?Sized,
|
||||
{
|
||||
type Error = <T as resolve::InputValueAsRef<S>>::Error;
|
||||
type Error = T::Error;
|
||||
|
||||
fn try_from_input_value(v: &'inp graphql::InputValue<S>) -> Result<Self, Self::Error> {
|
||||
<T as resolve::InputValueAsRef<S>>::try_from_input_value(v)
|
||||
fn try_from_input_value(v: &'i graphql::InputValue<SV>) -> Result<Self, Self::Error> {
|
||||
T::try_from_input_value(v)
|
||||
}
|
||||
|
||||
fn try_from_implicit_null() -> Result<Self, Self::Error> {
|
||||
<T as resolve::InputValueAsRef<S>>::try_from_implicit_null()
|
||||
T::try_from_implicit_null()
|
||||
}
|
||||
}
|
||||
|
||||
pub trait TryFromInputValue<S = DefaultScalarValue> {
|
||||
type Error: IntoFieldError<S>;
|
||||
|
||||
fn try_from_input_value(v: &graphql::InputValue<S>) -> Result<&Self, Self::Error>;
|
||||
|
||||
fn try_from_implicit_null<'a>() -> Result<&'a Self, Self::Error>
|
||||
impl<'me, 'i, T, SV, BH> resolve::InputValueAs<'i, &'me T, SV, BH> for T
|
||||
where
|
||||
S: 'a,
|
||||
'i: 'me,
|
||||
T: resolve::InputValueAsRef<SV, BH> + ?Sized,
|
||||
SV: 'i,
|
||||
BH: ?Sized,
|
||||
{
|
||||
Self::try_from_input_value(&graphql::InputValue::<S>::Null)
|
||||
type Error = T::Error;
|
||||
|
||||
fn try_from_input_value(v: &'i graphql::InputValue<SV>) -> Result<&'me T, Self::Error> {
|
||||
T::try_from_input_value(v)
|
||||
}
|
||||
|
||||
fn try_from_implicit_null() -> Result<&'me T, Self::Error> {
|
||||
T::try_from_implicit_null()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, S> resolve::ScalarToken<S> for &'me T
|
||||
impl<'me, T, SV, BH> resolve::ScalarToken<SV, BH> for &'me T
|
||||
where
|
||||
T: resolve::ScalarToken<S> + ?Sized,
|
||||
T: resolve::ScalarToken<SV, BH> + ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn parse_scalar_token(token: ScalarToken<'_>) -> Result<S, ParseError<'_>> {
|
||||
fn parse_scalar_token(token: ScalarToken<'_>) -> Result<SV, ParseError<'_>> {
|
||||
T::parse_scalar_token(token)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
impl<'me, 'i, T, Info, S: 'i> graphql::InputType<'i, Info, S> for &'me T
|
||||
impl<'me, 'i, T, TI, SV, BH> graphql::InputType<'i, TI, SV, BH> for &'me T
|
||||
where
|
||||
Self: resolve::Type<Info, S> + resolve::ToInputValue<S> + resolve::InputValue<'i, S>,
|
||||
Info: ?Sized,
|
||||
'i: 'me,
|
||||
T: graphql::InputTypeAs<'i, Self, TI, SV, BH> + ?Sized + 'me,
|
||||
TI: ?Sized,
|
||||
SV: 'i,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn assert_input_type() {
|
||||
T::assert_input_type()
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
impl<'me, T, S> graphql::OutputType<S> for &'me T
|
||||
impl<'me, T, TI, CX, SV, BH> graphql::OutputType<TI, CX, SV, BH> for &'me T
|
||||
where
|
||||
T: graphql::OutputType<S> + ?Sized,
|
||||
T: graphql::OutputType<TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn assert_output_type() {
|
||||
T::assert_output_type()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, S> graphql::Interface<S> for &'me T
|
||||
impl<'me, 'i, T, TI, CX, SV, BH> graphql::Scalar<'i, TI, CX, SV, BH> for &'me T
|
||||
where
|
||||
T: graphql::Interface<S> + ?Sized,
|
||||
{
|
||||
fn assert_interface() {
|
||||
T::assert_interface()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, S> graphql::Object<S> for &'me T
|
||||
where
|
||||
T: graphql::Object<S> + ?Sized,
|
||||
{
|
||||
fn assert_object() {
|
||||
T::assert_object()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, S> graphql::Scalar<S> for &'me T
|
||||
where
|
||||
T: graphql::Scalar<S> + ?Sized,
|
||||
'i: 'me,
|
||||
T: graphql::ScalarAs<'i, Self, TI, CX, SV, BH> + ?Sized + 'me,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
SV: 'i,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn assert_scalar() {
|
||||
T::assert_scalar()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, S> graphql::Union<S> for &'me T
|
||||
impl<'me, T, BH> reflect::BaseType<BH> for &'me T
|
||||
where
|
||||
T: graphql::Union<S> + ?Sized,
|
||||
{
|
||||
fn assert_union() {
|
||||
T::assert_union()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, S> reflect::BaseType<S> for &'me T
|
||||
where
|
||||
T: reflect::BaseType<S> + ?Sized,
|
||||
T: reflect::BaseType<BH> + ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
const NAME: reflect::Type = T::NAME;
|
||||
}
|
||||
|
||||
impl<'me, T, S> reflect::BaseSubTypes<S> for &'me T
|
||||
impl<'me, T, BH> reflect::BaseSubTypes<BH> for &'me T
|
||||
where
|
||||
T: reflect::BaseSubTypes<S> + ?Sized,
|
||||
T: reflect::BaseSubTypes<BH> + ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
const NAMES: reflect::Types = T::NAMES;
|
||||
}
|
||||
|
||||
impl<'me, T, S> reflect::WrappedType<S> for &'me T
|
||||
impl<'me, T, BH> reflect::WrappedType<BH> for &'me T
|
||||
where
|
||||
T: reflect::WrappedType<S> + ?Sized,
|
||||
T: reflect::WrappedType<BH> + ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
const VALUE: reflect::WrappedValue = T::VALUE;
|
||||
}
|
||||
*/
|
||||
|
|
|
@ -9,221 +9,200 @@ use crate::{
|
|||
reflect, resolve, Arguments, BoxFuture, ExecutionResult, Executor, Registry, Selection,
|
||||
};
|
||||
|
||||
/*
|
||||
impl<'me, T, Info, S> resolve::Type<Info, S> for &'me mut T
|
||||
impl<'me, T, TI, SV, BH> resolve::Type<TI, SV, BH> for &'me mut T
|
||||
where
|
||||
T: resolve::Type<Info, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
T: resolve::Type<TI, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn meta<'r>(registry: &mut Registry<'r, S>, info: &Info) -> MetaType<'r, S>
|
||||
fn meta<'r>(registry: &mut Registry<'r, SV>, info: &TI) -> MetaType<'r, SV>
|
||||
where
|
||||
S: 'r,
|
||||
SV: 'r,
|
||||
{
|
||||
T::meta(registry, info)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, Info> resolve::TypeName<Info> for &'me mut T
|
||||
impl<'me, T, TI, BH> resolve::TypeName<TI, BH> for &'me mut T
|
||||
where
|
||||
T: resolve::TypeName<Info> + ?Sized,
|
||||
Info: ?Sized,
|
||||
T: resolve::TypeName<TI, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn type_name(info: &Info) -> &str {
|
||||
fn type_name(info: &TI) -> &str {
|
||||
T::type_name(info)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, Info> resolve::ConcreteTypeName<Info> for &'me mut T
|
||||
impl<'me, T, TI, BH> resolve::ConcreteTypeName<TI, BH> for &'me mut T
|
||||
where
|
||||
T: resolve::ConcreteTypeName<Info> + ?Sized,
|
||||
Info: ?Sized,
|
||||
T: resolve::ConcreteTypeName<TI, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn concrete_type_name<'i>(&self, info: &'i Info) -> &'i str {
|
||||
fn concrete_type_name<'i>(&self, info: &'i TI) -> &'i str {
|
||||
(**self).concrete_type_name(info)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, Info, Ctx, S> resolve::Value<Info, Ctx, S> for &'me mut T
|
||||
impl<'me, T, TI, CX, SV, BH> resolve::Value<TI, CX, SV, BH> for &'me mut T
|
||||
where
|
||||
T: resolve::Value<Info, Ctx, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
Ctx: ?Sized,
|
||||
T: resolve::Value<TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn resolve_value(
|
||||
&self,
|
||||
selection_set: Option<&[Selection<'_, S>]>,
|
||||
info: &Info,
|
||||
executor: &Executor<Ctx, S>,
|
||||
) -> ExecutionResult<S> {
|
||||
(**self).resolve_value(selection_set, info, executor)
|
||||
selection_set: Option<&[Selection<'_, SV>]>,
|
||||
type_info: &TI,
|
||||
executor: &Executor<CX, SV>,
|
||||
) -> ExecutionResult<SV> {
|
||||
(**self).resolve_value(selection_set, type_info, executor)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, Info, Ctx, S> resolve::ValueAsync<Info, Ctx, S> for &'me mut T
|
||||
impl<'me, T, TI, CX, SV, BH> resolve::ValueAsync<TI, CX, SV, BH> for &'me mut T
|
||||
where
|
||||
T: resolve::ValueAsync<Info, Ctx, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
Ctx: ?Sized,
|
||||
T: resolve::ValueAsync<TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn resolve_value_async<'r>(
|
||||
&'r self,
|
||||
selection_set: Option<&'r [Selection<'_, S>]>,
|
||||
info: &'r Info,
|
||||
executor: &'r Executor<Ctx, S>,
|
||||
) -> BoxFuture<'r, ExecutionResult<S>> {
|
||||
(**self).resolve_value_async(selection_set, info, executor)
|
||||
selection_set: Option<&'r [Selection<'_, SV>]>,
|
||||
type_info: &'r TI,
|
||||
executor: &'r Executor<CX, SV>,
|
||||
) -> BoxFuture<'r, ExecutionResult<SV>> {
|
||||
(**self).resolve_value_async(selection_set, type_info, executor)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, Info, Ctx, S> resolve::ConcreteValue<Info, Ctx, S> for &'me mut T
|
||||
impl<'me, T, TI, CX, SV, BH> resolve::ConcreteValue<TI, CX, SV, BH> for &'me mut T
|
||||
where
|
||||
T: resolve::ConcreteValue<Info, Ctx, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
Ctx: ?Sized,
|
||||
T: resolve::ConcreteValue<TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn resolve_concrete_value(
|
||||
&self,
|
||||
type_name: &str,
|
||||
selection_set: Option<&[Selection<'_, S>]>,
|
||||
info: &Info,
|
||||
executor: &Executor<Ctx, S>,
|
||||
) -> ExecutionResult<S> {
|
||||
(**self).resolve_concrete_value(type_name, selection_set, info, executor)
|
||||
selection_set: Option<&[Selection<'_, SV>]>,
|
||||
type_info: &TI,
|
||||
executor: &Executor<CX, SV>,
|
||||
) -> ExecutionResult<SV> {
|
||||
(**self).resolve_concrete_value(type_name, selection_set, type_info, executor)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, Info, Ctx, S> resolve::ConcreteValueAsync<Info, Ctx, S> for &'me mut T
|
||||
impl<'me, T, TI, CX, SV, BH> resolve::ConcreteValueAsync<TI, CX, SV, BH> for &'me mut T
|
||||
where
|
||||
T: resolve::ConcreteValueAsync<Info, Ctx, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
Ctx: ?Sized,
|
||||
T: resolve::ConcreteValueAsync<TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn resolve_concrete_value_async<'r>(
|
||||
&'r self,
|
||||
type_name: &str,
|
||||
selection_set: Option<&'r [Selection<'_, S>]>,
|
||||
info: &'r Info,
|
||||
executor: &'r Executor<Ctx, S>,
|
||||
) -> BoxFuture<'r, ExecutionResult<S>> {
|
||||
(**self).resolve_concrete_value_async(type_name, selection_set, info, executor)
|
||||
selection_set: Option<&'r [Selection<'_, SV>]>,
|
||||
type_info: &'r TI,
|
||||
executor: &'r Executor<CX, SV>,
|
||||
) -> BoxFuture<'r, ExecutionResult<SV>> {
|
||||
(**self).resolve_concrete_value_async(type_name, selection_set, type_info, executor)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, Info, Ctx, S> resolve::Field<Info, Ctx, S> for &'me mut T
|
||||
impl<'me, T, TI, CX, SV, BH> resolve::Field<TI, CX, SV, BH> for &'me mut T
|
||||
where
|
||||
T: resolve::Field<Info, Ctx, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
Ctx: ?Sized,
|
||||
T: resolve::Field<TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn resolve_field(
|
||||
&self,
|
||||
field_name: &str,
|
||||
arguments: &Arguments<S>,
|
||||
info: &Info,
|
||||
executor: &Executor<Ctx, S>,
|
||||
) -> ExecutionResult<S> {
|
||||
(**self).resolve_field(field_name, arguments, info, executor)
|
||||
arguments: &Arguments<SV>,
|
||||
type_info: &TI,
|
||||
executor: &Executor<CX, SV>,
|
||||
) -> ExecutionResult<SV> {
|
||||
(**self).resolve_field(field_name, arguments, type_info, executor)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, Info, Ctx, S> resolve::FieldAsync<Info, Ctx, S> for &'me mut T
|
||||
impl<'me, T, TI, CX, SV, BH> resolve::FieldAsync<TI, CX, SV, BH> for &'me mut T
|
||||
where
|
||||
T: resolve::FieldAsync<Info, Ctx, S> + ?Sized,
|
||||
Info: ?Sized,
|
||||
Ctx: ?Sized,
|
||||
T: resolve::FieldAsync<TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn resolve_field_async<'r>(
|
||||
&'r self,
|
||||
field_name: &'r str,
|
||||
arguments: &'r Arguments<S>,
|
||||
info: &'r Info,
|
||||
executor: &'r Executor<Ctx, S>,
|
||||
) -> BoxFuture<'r, ExecutionResult<S>> {
|
||||
(**self).resolve_field_async(field_name, arguments, info, executor)
|
||||
arguments: &'r Arguments<SV>,
|
||||
type_info: &'r TI,
|
||||
executor: &'r Executor<CX, SV>,
|
||||
) -> BoxFuture<'r, ExecutionResult<SV>> {
|
||||
(**self).resolve_field_async(field_name, arguments, type_info, executor)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, S> resolve::ToInputValue<S> for &'me mut T
|
||||
impl<'me, T, SV, BH> resolve::ToInputValue<SV, BH> for &'me mut T
|
||||
where
|
||||
T: resolve::ToInputValue<S> + ?Sized,
|
||||
T: resolve::ToInputValue<SV, BH> + ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn to_input_value(&self) -> graphql::InputValue<S> {
|
||||
fn to_input_value(&self) -> graphql::InputValue<SV> {
|
||||
(**self).to_input_value()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, S> resolve::ScalarToken<S> for &'me mut T
|
||||
impl<'me, T, SV, BH> resolve::ScalarToken<SV, BH> for &'me mut T
|
||||
where
|
||||
T: resolve::ScalarToken<S> + ?Sized,
|
||||
T: resolve::ScalarToken<SV, BH> + ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn parse_scalar_token(token: ScalarToken<'_>) -> Result<S, ParseError<'_>> {
|
||||
fn parse_scalar_token(token: ScalarToken<'_>) -> Result<SV, ParseError<'_>> {
|
||||
T::parse_scalar_token(token)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, S> graphql::OutputType<S> for &'me mut T
|
||||
impl<'me, T, TI, CX, SV, BH> graphql::OutputType<TI, CX, SV, BH> for &'me mut T
|
||||
where
|
||||
T: graphql::OutputType<S> + ?Sized,
|
||||
T: graphql::OutputType<TI, CX, SV, BH> + ?Sized,
|
||||
TI: ?Sized,
|
||||
CX: ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
fn assert_output_type() {
|
||||
T::assert_output_type()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, S> graphql::Interface<S> for &'me mut T
|
||||
impl<'me, T, BH> reflect::BaseType<BH> for &'me mut T
|
||||
where
|
||||
T: graphql::Interface<S> + ?Sized,
|
||||
{
|
||||
fn assert_interface() {
|
||||
T::assert_interface()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, S> graphql::Object<S> for &'me mut T
|
||||
where
|
||||
T: graphql::Object<S> + ?Sized,
|
||||
{
|
||||
fn assert_object() {
|
||||
T::assert_object()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, S> graphql::Scalar<S> for &'me mut T
|
||||
where
|
||||
T: graphql::Scalar<S> + ?Sized,
|
||||
{
|
||||
fn assert_scalar() {
|
||||
T::assert_scalar()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, S> graphql::Union<S> for &'me mut T
|
||||
where
|
||||
T: graphql::Union<S> + ?Sized,
|
||||
{
|
||||
fn assert_union() {
|
||||
T::assert_union()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'me, T, S> reflect::BaseType<S> for &'me mut T
|
||||
where
|
||||
T: reflect::BaseType<S> + ?Sized,
|
||||
T: reflect::BaseType<BH> + ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
const NAME: reflect::Type = T::NAME;
|
||||
}
|
||||
|
||||
impl<'me, T, S> reflect::BaseSubTypes<S> for &'me mut T
|
||||
impl<'me, T, BH> reflect::BaseSubTypes<BH> for &'me mut T
|
||||
where
|
||||
T: reflect::BaseSubTypes<S> + ?Sized,
|
||||
T: reflect::BaseSubTypes<BH> + ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
const NAMES: reflect::Types = T::NAMES;
|
||||
}
|
||||
|
||||
impl<'me, T, S> reflect::WrappedType<S> for &'me mut T
|
||||
impl<'me, T, BH> reflect::WrappedType<BH> for &'me mut T
|
||||
where
|
||||
T: reflect::WrappedType<S> + ?Sized,
|
||||
T: reflect::WrappedType<BH> + ?Sized,
|
||||
BH: ?Sized,
|
||||
{
|
||||
const VALUE: reflect::WrappedValue = T::VALUE;
|
||||
}
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue