Struct async_graphql::types::connection::Edge

source ·
pub struct Edge<Cursor, Node, EdgeFields, Name = DefaultEdgeName>
where Cursor: CursorType + Send + Sync, Node: OutputType, EdgeFields: ObjectType, Name: EdgeNameType,
{ pub cursor: Cursor, pub node: Node, /* private fields */ }
Expand description

An edge in a connection.

Fields§

§cursor: Cursor

A cursor for use in pagination

§node: Node

The item at the end of the edge

Implementations§

source§

impl<Cursor, Node, EdgeFields, Name> Edge<Cursor, Node, EdgeFields, Name>
where Cursor: CursorType + Send + Sync, Node: OutputType, EdgeFields: ObjectType, Name: EdgeNameType,

source

pub async fn node(&self, ctx: &Context<'_>) -> Result<&Node>

source§

impl<Cursor, Node, EdgeFields, Name> Edge<Cursor, Node, EdgeFields, Name>
where Name: EdgeNameType, Cursor: CursorType + Send + Sync, Node: OutputType, EdgeFields: ObjectType,

source

pub fn with_additional_fields( cursor: Cursor, node: Node, additional_fields: EdgeFields, ) -> Self

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

source§

impl<Cursor, Node, Name> Edge<Cursor, Node, EmptyFields, Name>
where Cursor: CursorType + Send + Sync, Node: OutputType, Name: EdgeNameType,

source

pub fn new(cursor: Cursor, node: Node) -> Self

Create a new edge.

Trait Implementations§

source§

impl<Cursor, Node, EdgeFields, Name> ContainerType for Edge<Cursor, Node, EdgeFields, Name>
where Cursor: CursorType + Send + Sync, Node: OutputType, EdgeFields: ObjectType, Name: EdgeNameType,

source§

async fn resolve_field(&self, ctx: &Context<'_>) -> ServerResult<Option<Value>>

Resolves a field value and outputs it as a json value async_graphql::Value. 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§

fn find_entity( &self, _: &Context<'_>, _params: &Value, ) -> impl Future<Output = ServerResult<Option<Value>>> + Send

Find the GraphQL entity with the given name from the parameter. Read more
source§

impl<Cursor, Node, EdgeFields, Name> OutputType for Edge<Cursor, Node, EdgeFields, Name>
where Cursor: CursorType + Send + Sync, Node: OutputType, EdgeFields: ObjectType, Name: 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§

async fn resolve( &self, ctx: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

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, EdgeFields, Name> TypeName for Edge<Cursor, Node, EdgeFields, Name>
where Cursor: CursorType + Send + Sync, Node: OutputType, EdgeFields: ObjectType, Name: EdgeNameType,

source§

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

Returns a GraphQL type name.
source§

impl<Cursor, Node, EdgeFields, Name> ObjectType for Edge<Cursor, Node, EdgeFields, Name>
where Cursor: CursorType + Send + Sync, Node: OutputType, EdgeFields: ObjectType, Name: EdgeNameType,

Auto Trait Implementations§

§

impl<Cursor, Node, EdgeFields, Name> Freeze for Edge<Cursor, Node, EdgeFields, Name>
where Cursor: Freeze, Node: Freeze, EdgeFields: Freeze,

§

impl<Cursor, Node, EdgeFields, Name> RefUnwindSafe for Edge<Cursor, Node, EdgeFields, Name>
where Cursor: RefUnwindSafe, Node: RefUnwindSafe, EdgeFields: RefUnwindSafe, Name: RefUnwindSafe,

§

impl<Cursor, Node, EdgeFields, Name> Send for Edge<Cursor, Node, EdgeFields, Name>

§

impl<Cursor, Node, EdgeFields, Name> Sync for Edge<Cursor, Node, EdgeFields, Name>

§

impl<Cursor, Node, EdgeFields, Name> Unpin for Edge<Cursor, Node, EdgeFields, Name>
where Cursor: Unpin, Node: Unpin, EdgeFields: Unpin, Name: Unpin,

§

impl<Cursor, Node, EdgeFields, Name> UnwindSafe for Edge<Cursor, Node, EdgeFields, Name>
where Cursor: UnwindSafe, Node: UnwindSafe, EdgeFields: UnwindSafe, Name: 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, 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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.