Struct Syn1

Source
pub struct Syn1;
Expand description

Deserialization functions & types for Syn version 1

Trait Implementations§

Source§

impl SynVersion for Syn1

Source§

type Attribute = Attribute

A type that represents an attribute.
Source§

type ArgMeta = NestedMeta

Metadata that can be used to deserialize a value.
Source§

type Error = Error

A Syn Error.
Source§

fn deserialize_attr_args(attr: &Self::Attribute) -> Option<Vec<Self::ArgMeta>>

Parses an attribute list into a vector of its elements as metadata.
Source§

fn deserialize_list_args(meta: &Self::ArgMeta) -> Option<Vec<Self::ArgMeta>>

Parses a nested list into a vector of its elements as metadata.
Source§

fn deserialize_bool(meta: &Self::ArgMeta) -> Option<bool>

Attempts to get a boolean from an argument. Returns None if the argument is a different type.
Source§

fn deserialize_attr_key(meta: &Self::Attribute) -> Option<String>

Gets the name of an attribute list.
Source§

fn deserialize_key(meta: &Self::ArgMeta) -> Option<String>

Gets the key from a key value pair as a string.
Source§

fn deserialize_integer<T>(meta: &Self::ArgMeta) -> Option<T>
where T: FromStr, T::Err: Display,

Attempts to get an integer from an argument. Returns None if the argument is a different type.
Source§

fn deserialize_float<T>(meta: &Self::ArgMeta) -> Option<T>
where T: FromStr, T::Err: Display,

Attempts to get a float from an argument. Returns None if the argument is a different type.
Source§

fn deserialize_string(meta: &Self::ArgMeta) -> Option<String>

Attempts to get a string from an argument. Returns None if the argument is a different type.
Source§

fn deserialize_array(meta: &Self::ArgMeta) -> Option<Vec<Self::ArgMeta>>

Attempts to get an array from an argument and returns a vector of its elements as metadata.
Source§

fn convert_error(error: Error) -> Self::Error

Converts this crates error into a Syn error.

Auto Trait Implementations§

§

impl Freeze for Syn1

§

impl RefUnwindSafe for Syn1

§

impl Send for Syn1

§

impl Sync for Syn1

§

impl Unpin for Syn1

§

impl UnwindSafe for Syn1

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