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>

source

pub fn new(uuid: Uuid) -> Self

new creates a new RelayNodeID from a UUID string and a type specified as a generic.

source

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.

source

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.

source

pub fn to_uuid(&self) -> Uuid

to_uuid will convert the RelayNodeID into a normal UUID for use in DB queries or internal processing. The Uuid from this function is NOT globally unique!

Trait Implementations§

source§

impl<T: Clone + RelayNode + ?Sized> Clone for RelayNodeID<T>

source§

fn clone(&self) -> RelayNodeID<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: RelayNode> Debug for RelayNodeID<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: RelayNode> From<&RelayNodeID<T>> for String

source§

fn from(id: &RelayNodeID<T>) -> Self

Converts to this type from the input type.
source§

impl<T: RelayNode + Send + Sync> InputType for RelayNodeID<T>

§

type RawValueType = RelayNodeID<T>

The raw type used for validator. Read more
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 parse(value: Option<Value>) -> InputValueResult<Self>

Parse from Value. None represents undefined.
source§

fn to_value(&self) -> Value

Convert to a Value for introspection.
source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

Returns a reference to the raw value.
source§

fn qualified_type_name() -> String

Qualified typename.
source§

impl<T: RelayNode + Send + Sync> OutputType for RelayNodeID<T>

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, _: &'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

Qualified typename.
source§

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

Introspection type name Read more
source§

impl<T: PartialEq + RelayNode + ?Sized> PartialEq<RelayNodeID<T>> for RelayNodeID<T>

source§

fn eq(&self, other: &RelayNodeID<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: RelayNode + Send + Sync> ScalarType for RelayNodeID<T>

source§

fn parse(value: Value) -> InputValueResult<Self>

Parse a scalar value.
source§

fn to_value(&self) -> Value

Convert the scalar to Value.
source§

fn is_valid(_value: &ConstValue) -> bool

Checks for a valid scalar value. Read more
source§

impl<T: RelayNode> ToString for RelayNodeID<T>

source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T: Eq + RelayNode + ?Sized> Eq for RelayNodeID<T>

source§

impl<T: RelayNode + ?Sized> StructuralEq for RelayNodeID<T>

source§

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere 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 Twhere 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.