Edge

Struct 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§

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 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<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _: &'life1 Context<'life2>, _: &'life3 Value, ) -> Pin<Box<dyn Future<Output = ServerResult<Option<Value>>> + Send + 'async_trait>>
where Self: Sync + '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§

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§

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