pub struct Schema<Query, Mutation, Subscription>(/* private fields */);
Expand description
GraphQL schema.
Cloning a schema is cheap, so it can be easily shared.
Implementations§
Source§impl<Query, Mutation, Subscription>Schema<Query, Mutation, Subscription>where Query:ObjectType + 'static, Mutation:ObjectType + 'static, Subscription:SubscriptionType + 'static,
impl<Query, Mutation, Subscription>Schema<Query, Mutation, Subscription>where Query:ObjectType + 'static, Mutation:ObjectType + 'static, Subscription:SubscriptionType + 'static,
Sourcepub fnbuild( query: Query, mutation: Mutation, subscription: Subscription,) ->SchemaBuilder<Query, Mutation, Subscription>
pub fnbuild( query: Query, mutation: Mutation, subscription: Subscription,) ->SchemaBuilder<Query, Mutation, Subscription>
Create a schema builder
The root object for the query and Mutation needs to be specified.If there is no mutation, you can useEmptyMutation
.If there is no subscription, you can useEmptySubscription
.
Sourcepub fnbuild_with_ignore_name_conflicts<I, T>( query: Query, mutation: Mutation, subscription: Subscription, ignore_name_conflicts: I,) ->SchemaBuilder<Query, Mutation, Subscription>
pub fnbuild_with_ignore_name_conflicts<I, T>( query: Query, mutation: Mutation, subscription: Subscription, ignore_name_conflicts: I,) ->SchemaBuilder<Query, Mutation, Subscription>
Create a schema builder and specifies a list to ignore type conflictdetection.
NOTE: It is not recommended to use it unless you know what it does.
Sourcepub fnnew( query: Query, mutation: Mutation, subscription: Subscription,) ->Schema<Query, Mutation, Subscription>
pub fnnew( query: Query, mutation: Mutation, subscription: Subscription,) ->Schema<Query, Mutation, Subscription>
Create a schema
Sourcepub fnsdl_with_options(&self, options:SDLExportOptions) ->String
pub fnsdl_with_options(&self, options:SDLExportOptions) ->String
Returns SDL(Schema Definition Language) of this schema with options.
Sourcepub fnnames(&self) ->Vec<String>
pub fnnames(&self) ->Vec<String>
Get all names in this schema
Maybe you want to serialize a custom binary protocol. In order tominimize message size, a dictionary is usually used to compress typenames, field names, directive names, and parameter names. This functiongets all the names, so you can create this dictionary.
Sourcepub async fnexecute_batch(&self, batch_request:BatchRequest) ->BatchResponse
pub async fnexecute_batch(&self, batch_request:BatchRequest) ->BatchResponse
Execute a GraphQL batch query.
Trait Implementations§
Source§impl<Query, Mutation, Subscription>Default forSchema<Query, Mutation, Subscription>where Query:Default +ObjectType + 'static, Mutation:Default +ObjectType + 'static, Subscription:Default +SubscriptionType + 'static,
impl<Query, Mutation, Subscription>Default forSchema<Query, Mutation, Subscription>where Query:Default +ObjectType + 'static, Mutation:Default +ObjectType + 'static, Subscription:Default +SubscriptionType + 'static,
Source§impl<Query, Mutation, Subscription>Executor forSchema<Query, Mutation, Subscription>where Query:ObjectType + 'static, Mutation:ObjectType + 'static, Subscription:SubscriptionType + 'static,
impl<Query, Mutation, Subscription>Executor forSchema<Query, Mutation, Subscription>where Query:ObjectType + 'static, Mutation:ObjectType + 'static, Subscription:SubscriptionType + 'static,
Source§fnexecute<'life0, 'async_trait>( &'life0 self, request:Request,) ->Pin<Box<dynFuture<Output =Response> +Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
fnexecute<'life0, 'async_trait>( &'life0 self, request:Request,) ->Pin<Box<dynFuture<Output =Response> +Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Source§fnexecute_stream( &self, request:Request, session_data:Option<Arc<Data>>,) ->BoxStream<'static,Response>
fnexecute_stream( &self, request:Request, session_data:Option<Arc<Data>>,) ->BoxStream<'static,Response>
Source§fnexecute_batch<'life0, 'async_trait>( &'life0 self, batch_request:BatchRequest,) ->Pin<Box<dynFuture<Output =BatchResponse> +Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
fnexecute_batch<'life0, 'async_trait>( &'life0 self, batch_request:BatchRequest,) ->Pin<Box<dynFuture<Output =BatchResponse> +Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Auto Trait Implementations§
impl<Query, Mutation, Subscription>Freeze forSchema<Query, Mutation, Subscription>
impl<Query, Mutation, Subscription> !RefUnwindSafe forSchema<Query, Mutation, Subscription>
impl<Query, Mutation, Subscription>Send forSchema<Query, Mutation, Subscription>
impl<Query, Mutation, Subscription>Sync forSchema<Query, Mutation, Subscription>
impl<Query, Mutation, Subscription>Unpin forSchema<Query, Mutation, Subscription>
impl<Query, Mutation, Subscription> !UnwindSafe forSchema<Query, Mutation, Subscription>
Blanket Implementations§
Source§impl<T>BorrowMut<T> for Twhere T: ?Sized,
impl<T>BorrowMut<T> for Twhere T: ?Sized,
Source§fnborrow_mut(&mut self) ->&mut T
fnborrow_mut(&mut self) ->&mut T
Source§impl<T>CloneToUninit for Twhere T:Clone,
impl<T>CloneToUninit for Twhere T:Clone,
Source§impl<T>FmtForward for T
impl<T>FmtForward for T
Source§fnfmt_binary(self) ->FmtBinary<Self>where Self:Binary,
fnfmt_binary(self) ->FmtBinary<Self>where Self:Binary,
self
to use itsBinary
implementation whenDebug
-formatted.Source§fnfmt_display(self) ->FmtDisplay<Self>where Self:Display,
fnfmt_display(self) ->FmtDisplay<Self>where Self:Display,
self
to use itsDisplay
implementation whenDebug
-formatted.Source§fnfmt_lower_exp(self) ->FmtLowerExp<Self>where Self:LowerExp,
fnfmt_lower_exp(self) ->FmtLowerExp<Self>where Self:LowerExp,
self
to use itsLowerExp
implementation whenDebug
-formatted.Source§fnfmt_lower_hex(self) ->FmtLowerHex<Self>where Self:LowerHex,
fnfmt_lower_hex(self) ->FmtLowerHex<Self>where Self:LowerHex,
self
to use itsLowerHex
implementation whenDebug
-formatted.Source§fnfmt_octal(self) ->FmtOctal<Self>where Self:Octal,
fnfmt_octal(self) ->FmtOctal<Self>where Self:Octal,
self
to use itsOctal
implementation whenDebug
-formatted.Source§fnfmt_pointer(self) ->FmtPointer<Self>where Self:Pointer,
fnfmt_pointer(self) ->FmtPointer<Self>where Self:Pointer,
self
to use itsPointer
implementation whenDebug
-formatted.Source§fnfmt_upper_exp(self) ->FmtUpperExp<Self>where Self:UpperExp,
fnfmt_upper_exp(self) ->FmtUpperExp<Self>where Self:UpperExp,
self
to use itsUpperExp
implementation whenDebug
-formatted.Source§fnfmt_upper_hex(self) ->FmtUpperHex<Self>where Self:UpperHex,
fnfmt_upper_hex(self) ->FmtUpperHex<Self>where Self:UpperHex,
self
to use itsUpperHex
implementation whenDebug
-formatted.Source§impl<T>FutureExt for T
impl<T>FutureExt for T
Source§fnwith_context(self, otel_cx:Context) ->WithContext<Self>ⓘ
fnwith_context(self, otel_cx:Context) ->WithContext<Self>ⓘ
Source§fnwith_current_context(self) ->WithContext<Self>ⓘ
fnwith_current_context(self) ->WithContext<Self>ⓘ
Source§impl<T>Instrument for T
impl<T>Instrument for T
Source§fninstrument(self, span:Span) ->Instrumented<Self>ⓘ
fninstrument(self, span:Span) ->Instrumented<Self>ⓘ
Source§fnin_current_span(self) ->Instrumented<Self>ⓘ
fnin_current_span(self) ->Instrumented<Self>ⓘ
Source§impl<T>Instrument for T
impl<T>Instrument for T
Source§fninstrument(self, span:Span) ->Instrumented<Self>ⓘ
fninstrument(self, span:Span) ->Instrumented<Self>ⓘ
Source§fnin_current_span(self) ->Instrumented<Self>ⓘ
fnin_current_span(self) ->Instrumented<Self>ⓘ
Source§impl<T>IntoEither for T
impl<T>IntoEither for T
Source§fninto_either(self, into_left:bool) ->Either<Self, Self>ⓘ
fninto_either(self, into_left:bool) ->Either<Self, Self>ⓘ
self
into aLeft
variant ofEither<Self, Self>
ifinto_left
istrue
.Convertsself
into aRight
variant ofEither<Self, Self>
otherwise.Read moreSource§fninto_either_with<F>(self, into_left: F) ->Either<Self, Self>ⓘ
fninto_either_with<F>(self, into_left: F) ->Either<Self, Self>ⓘ
self
into aLeft
variant ofEither<Self, Self>
ifinto_left(&self)
returnstrue
.Convertsself
into aRight
variant ofEither<Self, Self>
otherwise.Read moreSource§impl<T>Pipe for Twhere T: ?Sized,
impl<T>Pipe for Twhere T: ?Sized,
Source§fnpipe<R>(self, func: implFnOnce(Self) -> R) -> Rwhere Self:Sized,
fnpipe<R>(self, func: implFnOnce(Self) -> R) -> Rwhere Self:Sized,
Source§fnpipe_ref<'a, R>(&'a self, func: implFnOnce(&'a Self) -> R) -> Rwhere R: 'a,
fnpipe_ref<'a, R>(&'a self, func: implFnOnce(&'a Self) -> R) -> Rwhere R: 'a,
self
and passes that borrow into the pipe function.Read moreSource§fnpipe_ref_mut<'a, R>(&'a mut self, func: implFnOnce(&'a mut Self) -> R) -> Rwhere R: 'a,
fnpipe_ref_mut<'a, R>(&'a mut self, func: implFnOnce(&'a mut Self) -> R) -> Rwhere R: 'a,
self
and passes that borrow into the pipe function.Read moreSource§fnpipe_borrow<'a, B, R>(&'a self, func: implFnOnce(&'a B) -> R) -> R
fnpipe_borrow<'a, B, R>(&'a self, func: implFnOnce(&'a B) -> R) -> R
Source§fnpipe_borrow_mut<'a, B, R>( &'a mut self, func: implFnOnce(&'a mut B) -> R,) -> R
fnpipe_borrow_mut<'a, B, R>( &'a mut self, func: implFnOnce(&'a mut B) -> R,) -> R
Source§fnpipe_as_ref<'a, U, R>(&'a self, func: implFnOnce(&'a U) -> R) -> R
fnpipe_as_ref<'a, U, R>(&'a self, func: implFnOnce(&'a U) -> R) -> R
self
, then passesself.as_ref()
into the pipe function.Source§fnpipe_as_mut<'a, U, R>(&'a mut self, func: implFnOnce(&'a mut U) -> R) -> R
fnpipe_as_mut<'a, U, R>(&'a mut self, func: implFnOnce(&'a mut U) -> R) -> R
self
, then passesself.as_mut()
into the pipefunction.Source§fnpipe_deref<'a, T, R>(&'a self, func: implFnOnce(&'a T) -> R) -> R
fnpipe_deref<'a, T, R>(&'a self, func: implFnOnce(&'a T) -> R) -> R
self
, then passesself.deref()
into the pipe function.Source§impl<T>Tap for T
impl<T>Tap for T
Source§fntap_borrow<B>(self, func: implFnOnce(&B)) -> Self
fntap_borrow<B>(self, func: implFnOnce(&B)) -> Self
Borrow<B>
of a value.Read moreSource§fntap_borrow_mut<B>(self, func: implFnOnce(&mut B)) -> Self
fntap_borrow_mut<B>(self, func: implFnOnce(&mut B)) -> Self
BorrowMut<B>
of a value.Read moreSource§fntap_ref<R>(self, func: implFnOnce(&R)) -> Self
fntap_ref<R>(self, func: implFnOnce(&R)) -> Self
AsRef<R>
view of a value.Read moreSource§fntap_ref_mut<R>(self, func: implFnOnce(&mut R)) -> Self
fntap_ref_mut<R>(self, func: implFnOnce(&mut R)) -> Self
AsMut<R>
view of a value.Read moreSource§fntap_deref<T>(self, func: implFnOnce(&T)) -> Self
fntap_deref<T>(self, func: implFnOnce(&T)) -> Self
Deref::Target
of a value.Read moreSource§fntap_deref_mut<T>(self, func: implFnOnce(&mut T)) -> Self
fntap_deref_mut<T>(self, func: implFnOnce(&mut T)) -> Self
Deref::Target
of a value.Read moreSource§fntap_dbg(self, func: implFnOnce(&Self)) -> Self
fntap_dbg(self, func: implFnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.Source§fntap_mut_dbg(self, func: implFnOnce(&mut Self)) -> Self
fntap_mut_dbg(self, func: implFnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in releasebuilds.Source§fntap_borrow_dbg<B>(self, func: implFnOnce(&B)) -> Self
fntap_borrow_dbg<B>(self, func: implFnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in releasebuilds.Source§fntap_borrow_mut_dbg<B>(self, func: implFnOnce(&mut B)) -> Self
fntap_borrow_mut_dbg<B>(self, func: implFnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in releasebuilds.Source§fntap_ref_dbg<R>(self, func: implFnOnce(&R)) -> Self
fntap_ref_dbg<R>(self, func: implFnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in releasebuilds.Source§fntap_ref_mut_dbg<R>(self, func: implFnOnce(&mut R)) -> Self
fntap_ref_mut_dbg<R>(self, func: implFnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in releasebuilds.Source§fntap_deref_dbg<T>(self, func: implFnOnce(&T)) -> Self
fntap_deref_dbg<T>(self, func: implFnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in releasebuilds.