pub struct CustomArg<T>(pub T);
Expand description
Allows a type to implement CustomArgFromMeta
, a simplified version of TryFromMeta
.
Tuple Fields§
§0: T
Trait Implementations§
Source§impl<V: SynVersion, T: CustomArgFromMeta<V>> TryFromMeta<V> for CustomArg<T>
impl<V: SynVersion, T: CustomArgFromMeta<V>> TryFromMeta<V> for CustomArg<T>
Source§type InitialType = CustomArg<T>
type InitialType = CustomArg<T>
This is the initial type and will be converted to
For most types this is typically Self but for lists this is a builder.
Self
in the validate
function. For most types this is typically Self but for lists this is a builder.
Source§type Metadata = <V as SynVersion>::ArgMeta
type Metadata = <V as SynVersion>::ArgMeta
The metadata of an argument or an attribute.
Source§fn try_from_meta(meta: Self::Metadata) -> ArgResult<Self::InitialType>
fn try_from_meta(meta: Self::Metadata) -> ArgResult<Self::InitialType>
Looks for values & errors in the metadata.
The returned result is added to the argument’s state using the
The returned result is added to the argument’s state using the
concat
method on ArgResult
which in turn will call the initial type’s Concat
implementation if found.Auto Trait Implementations§
impl<T> Freeze for CustomArg<T>where
T: Freeze,
impl<T> RefUnwindSafe for CustomArg<T>where
T: RefUnwindSafe,
impl<T> Send for CustomArg<T>where
T: Send,
impl<T> Sync for CustomArg<T>where
T: Sync,
impl<T> Unpin for CustomArg<T>where
T: Unpin,
impl<T> UnwindSafe for CustomArg<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