Connection

Struct Connection 

Source
pub struct Connection<Cursor, Node, ConnectionFields = EmptyFields, EdgeFields = EmptyFields, Name = DefaultConnectionName, EdgeName = DefaultEdgeName, NodesField = EnableNodesField>
where Cursor: CursorType + Send + Sync, Node: OutputType, ConnectionFields: ObjectType, EdgeFields: ObjectType, Name: ConnectionNameType, EdgeName: EdgeNameType, NodesField: NodesFieldSwitcherSealed,
{ pub edges: Vec<Edge<Cursor, Node, EdgeFields, EdgeName>>, pub additional_fields: ConnectionFields, pub has_previous_page: bool, pub has_next_page: bool, /* private fields */ }
Expand description

Connection type

Connection is the result of a query for connection::query.

Fields§

§edges: Vec<Edge<Cursor, Node, EdgeFields, EdgeName>>

All edges of the current page.

§additional_fields: ConnectionFields

Additional fields for connection object.

§has_previous_page: bool

If true means has previous page.

§has_next_page: bool

If true means has next page.

Implementations§

Source§

impl<Cursor, Node, NodesField, EdgeFields, Name, EdgeName> Connection<Cursor, Node, EmptyFields, EdgeFields, Name, EdgeName, NodesField>
where Cursor: CursorType + Send + Sync, Node: OutputType, EdgeFields: ObjectType, Name: ConnectionNameType, EdgeName: EdgeNameType, NodesField: NodesFieldSwitcherSealed,

Source

pub fn new(has_previous_page: bool, has_next_page: bool) -> Self

Create a new connection.

Source§

impl<Cursor, Node, NodesField, ConnectionFields, EdgeFields, Name, EdgeName> Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField>
where Cursor: CursorType + Send + Sync, Node: OutputType, ConnectionFields: ObjectType, EdgeFields: ObjectType, Name: ConnectionNameType, EdgeName: EdgeNameType, NodesField: NodesFieldSwitcherSealed,

Source

pub fn with_additional_fields( has_previous_page: bool, has_next_page: bool, additional_fields: ConnectionFields, ) -> Self

Create a new connection, it can have some additional fields.

Trait Implementations§

Source§

impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName> ContainerType for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, EnableNodesField>
where Cursor: CursorType + Send + Sync, Node: OutputType, ConnectionFields: ObjectType, EdgeFields: ObjectType, Name: ConnectionNameType, EdgeName: EdgeNameType,

Source§

fn resolve_field<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 Context<'life2>, ) -> Pin<Box<dyn Future<Output = ServerResult<Option<Value>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Available on crate feature boxed-trait only.
Resolves a field value and outputs it as a json value async_graphql::Value. Read more
Source§

fn find_entity<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, ctx: &'life1 Context<'life2>, params: &'life3 Value, ) -> Pin<Box<dyn Future<Output = ServerResult<Option<Value>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Available on crate feature boxed-trait only.
Find the GraphQL entity with the given name from the parameter. Read more
Source§

fn collect_all_fields<'a>( &'a self, ctx: &ContextSelectionSet<'a>, fields: &mut Fields<'a>, ) -> ServerResult<()>
where Self: Send + Sync,

Collect all the fields of the container that are queried in the selection set. Read more
Source§

impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName> ContainerType for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, DisableNodesField>
where Cursor: CursorType + Send + Sync, Node: OutputType, ConnectionFields: ObjectType, EdgeFields: ObjectType, Name: ConnectionNameType, EdgeName: EdgeNameType,

Source§

fn resolve_field<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 Context<'life2>, ) -> Pin<Box<dyn Future<Output = ServerResult<Option<Value>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Available on crate feature boxed-trait only.
Resolves a field value and outputs it as a json value async_graphql::Value. Read more
Source§

fn find_entity<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, ctx: &'life1 Context<'life2>, params: &'life3 Value, ) -> Pin<Box<dyn Future<Output = ServerResult<Option<Value>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Available on crate feature boxed-trait only.
Find the GraphQL entity with the given name from the parameter. Read more
Source§

fn collect_all_fields<'a>( &'a self, ctx: &ContextSelectionSet<'a>, fields: &mut Fields<'a>, ) -> ServerResult<()>
where Self: Send + Sync,

Collect all the fields of the container that are queried in the selection set. Read more
Source§

impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName> OutputType for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, EnableNodesField>
where Cursor: CursorType + Send + Sync, Node: OutputType, ConnectionFields: ObjectType, EdgeFields: ObjectType, Name: ConnectionNameType, EdgeName: EdgeNameType,

Source§

fn type_name() -> Cow<'static, str>

Type the name.
Source§

fn create_type_info(registry: &mut Registry) -> String

Create type information in the registry and return qualified typename.
Source§

fn resolve<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, ctx: &'life1 ContextSelectionSet<'life2>, _field: &'life3 Positioned<Field>, ) -> Pin<Box<dyn Future<Output = ServerResult<Value>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Available on crate feature boxed-trait only.
Resolve an output value to async_graphql::Value.
Source§

fn qualified_type_name() -> String

Qualified typename.
Source§

fn introspection_type_name(&self) -> Cow<'static, str>

Introspection type name Read more
Source§

impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName> OutputType for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, DisableNodesField>
where Cursor: CursorType + Send + Sync, Node: OutputType, ConnectionFields: ObjectType, EdgeFields: ObjectType, Name: ConnectionNameType, EdgeName: EdgeNameType,

Source§

fn type_name() -> Cow<'static, str>

Type the name.
Source§

fn create_type_info(registry: &mut Registry) -> String

Create type information in the registry and return qualified typename.
Source§

fn resolve<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, ctx: &'life1 ContextSelectionSet<'life2>, _field: &'life3 Positioned<Field>, ) -> Pin<Box<dyn Future<Output = ServerResult<Value>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Available on crate feature boxed-trait only.
Resolve an output value to async_graphql::Value.
Source§

fn qualified_type_name() -> String

Qualified typename.
Source§

fn introspection_type_name(&self) -> Cow<'static, str>

Introspection type name Read more
Source§

impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField> TypeName for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField>
where Cursor: CursorType + Send + Sync, Node: OutputType, ConnectionFields: ObjectType, EdgeFields: ObjectType, Name: ConnectionNameType, EdgeName: EdgeNameType, NodesField: NodesFieldSwitcherSealed,

Source§

fn type_name() -> Cow<'static, str>

Returns a GraphQL type name.
Source§

impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName> ObjectType for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, EnableNodesField>
where Cursor: CursorType + Send + Sync, Node: OutputType, ConnectionFields: ObjectType, EdgeFields: ObjectType, Name: ConnectionNameType, EdgeName: EdgeNameType,

Source§

impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName> ObjectType for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, DisableNodesField>
where Cursor: CursorType + Send + Sync, Node: OutputType, ConnectionFields: ObjectType, EdgeFields: ObjectType, Name: ConnectionNameType, EdgeName: EdgeNameType,

Auto Trait Implementations§

§

impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField> Freeze for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField>
where ConnectionFields: Freeze,

§

impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField> RefUnwindSafe for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField>
where ConnectionFields: RefUnwindSafe, Name: RefUnwindSafe, EdgeName: RefUnwindSafe, NodesField: RefUnwindSafe, Cursor: RefUnwindSafe, Node: RefUnwindSafe, EdgeFields: RefUnwindSafe,

§

impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField> Send for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField>

§

impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField> Sync for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField>

§

impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField> Unpin for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField>
where ConnectionFields: Unpin, Name: Unpin, EdgeName: Unpin, NodesField: Unpin, Cursor: Unpin, Node: Unpin, EdgeFields: Unpin,

§

impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField> UnwindSafe for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField>
where ConnectionFields: UnwindSafe, Name: UnwindSafe, EdgeName: UnwindSafe, NodesField: UnwindSafe, Cursor: UnwindSafe, Node: UnwindSafe, EdgeFields: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more