pub type ID = Id;
Aliased Type§
struct ID(/* private fields */);
Implementations
§impl Id
impl Id
pub 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");
pub fn into_inner(self) -> String
pub fn into_inner(self) -> String
Converts this Id
into its inner value
pub 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
§impl<'de> Deserialize<'de> for Id
impl<'de> Deserialize<'de> for Id
§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
§impl IsScalar<Id> for Id
impl IsScalar<Id> for Id
§type SchemaType = Id
type SchemaType = Id
The schema marker type this scalar represents.
§impl Serialize for Id
impl Serialize for Id
§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