Struct async_graphql_relay::RelayNodeID
source · pub struct RelayNodeID<T: RelayNode + ?Sized>(_, _);
Expand description
RelayNodeID is a wrapper around a UUID with the use of the ‘RelayNodeStruct’ trait to ensure each object has a globally unique ID.
Implementations§
source§impl<T: RelayNode> RelayNodeID<T>
impl<T: RelayNode> RelayNodeID<T>
sourcepub fn new(uuid: Uuid) -> Self
pub fn new(uuid: Uuid) -> Self
new creates a new RelayNodeID from a UUID string and a type specified as a generic.
sourcepub fn new_from_relay_id(relay_id: String) -> Result<Self, Error>
pub fn new_from_relay_id(relay_id: String) -> Result<Self, Error>
new_from_relay_id takes in a generic relay ID and converts it into a RelayNodeID.
sourcepub fn new_from_str(uuid: &str) -> Result<Self, Error>
pub fn new_from_str(uuid: &str) -> Result<Self, Error>
new_from_str is a wrapper around ‘Uuid::from_str’ to create a new RelayNodeID from a UUIDv4 string.
Trait Implementations§
source§impl<T: Clone + RelayNode + ?Sized> Clone for RelayNodeID<T>
impl<T: Clone + RelayNode + ?Sized> Clone for RelayNodeID<T>
source§fn clone(&self) -> RelayNodeID<T>
fn clone(&self) -> RelayNodeID<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: RelayNode> Debug for RelayNodeID<T>
impl<T: RelayNode> Debug for RelayNodeID<T>
source§impl<T: RelayNode> From<&RelayNodeID<T>> for String
impl<T: RelayNode> From<&RelayNodeID<T>> for String
source§fn from(id: &RelayNodeID<T>) -> Self
fn from(id: &RelayNodeID<T>) -> Self
Converts to this type from the input type.
source§impl<T: RelayNode + Send + Sync> InputType for RelayNodeID<T>
impl<T: RelayNode + Send + Sync> InputType for RelayNodeID<T>
§type RawValueType = RelayNodeID<T>
type RawValueType = RelayNodeID<T>
The raw type used for validator. Read more
source§fn create_type_info(registry: &mut Registry) -> String
fn create_type_info(registry: &mut Registry) -> String
Create type information in the registry and return qualified typename.
source§fn parse(value: Option<Value>) -> InputValueResult<Self>
fn parse(value: Option<Value>) -> InputValueResult<Self>
Parse from
Value
. None represents undefined.source§fn as_raw_value(&self) -> Option<&Self::RawValueType>
fn as_raw_value(&self) -> Option<&Self::RawValueType>
Returns a reference to the raw value.
source§fn qualified_type_name() -> String
fn qualified_type_name() -> String
Qualified typename.
source§impl<T: RelayNode + Send + Sync> OutputType for RelayNodeID<T>
impl<T: RelayNode + Send + Sync> OutputType for RelayNodeID<T>
source§fn create_type_info(registry: &mut Registry) -> String
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,
_: &'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,
fn resolve<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _: &'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,
Resolve an output value to
async_graphql::Value
.source§fn qualified_type_name() -> String
fn qualified_type_name() -> String
Qualified typename.
source§impl<T: PartialEq + RelayNode + ?Sized> PartialEq<RelayNodeID<T>> for RelayNodeID<T>
impl<T: PartialEq + RelayNode + ?Sized> PartialEq<RelayNodeID<T>> for RelayNodeID<T>
source§fn eq(&self, other: &RelayNodeID<T>) -> bool
fn eq(&self, other: &RelayNodeID<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T: RelayNode + Send + Sync> ScalarType for RelayNodeID<T>
impl<T: RelayNode + Send + Sync> ScalarType for RelayNodeID<T>
source§impl<T: RelayNode> ToString for RelayNodeID<T>
impl<T: RelayNode> ToString for RelayNodeID<T>
impl<T: Eq + RelayNode + ?Sized> Eq for RelayNodeID<T>
impl<T: RelayNode + ?Sized> StructuralEq for RelayNodeID<T>
impl<T: RelayNode + ?Sized> StructuralPartialEq for RelayNodeID<T>
Auto Trait Implementations§
impl<T: ?Sized> RefUnwindSafe for RelayNodeID<T>where T: RefUnwindSafe,
impl<T: ?Sized> Send for RelayNodeID<T>where T: Send,
impl<T: ?Sized> Sync for RelayNodeID<T>where T: Sync,
impl<T: ?Sized> Unpin for RelayNodeID<T>where T: Unpin,
impl<T: ?Sized> UnwindSafe for RelayNodeID<T>where T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.