pub struct Id(/* private fields */);
Expand description
A GraphQL ID
Any field in a GraphQL schema that has the type ID
should be represented
by this struct.
Implementations§
Source§impl Id
impl Id
Sourcepub fn new(s: impl Into<String>) -> Id
pub fn new(s: impl Into<String>) -> Id
Constructs an ID
from a String
, &str
or similar
cynic::Id::new("123");
Sourcepub fn into_inner(self) -> String
pub fn into_inner(self) -> String
Converts this Id
into its inner value
Sourcepub fn from_ref(s: &String) -> &Id
pub fn from_ref(s: &String) -> &Id
Converts a reference to a String to a reference to an Id
To be used when you can access an &String
which you want to assume is
an Id
for use in Cynic structures without reallocating
If you don’t have a String
at hand but only an &str
, you should know
that these can be used directly in InputObject
s as well when the
target GraphQL type is an Id
.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Id
impl<'de> Deserialize<'de> for Id
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Id, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Id, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl IsScalar<Id> for Id
impl IsScalar<Id> for Id
Source§type SchemaType = Id
type SchemaType = Id
The schema marker type this scalar represents.
Source§impl Serialize for Id
impl Serialize for Id
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl CoercesTo<Id> for Id
impl CoercesTo<Id> for str
impl CoercesTo<Option<Id>> for Id
impl CoercesTo<Option<Option<Id>>> for Id
impl CoercesTo<Option<Vec<Id>>> for Id
impl CoercesTo<Option<Vec<Option<Id>>>> for Id
impl CoercesTo<Vec<Id>> for Id
impl CoercesTo<Vec<Vec<Id>>> for Id
impl Eq for Id
impl StructuralPartialEq for Id
Auto Trait Implementations§
impl Freeze for Id
impl RefUnwindSafe for Id
impl Send for Id
impl Sync for Id
impl Unpin for Id
impl UnwindSafe for Id
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.