Struct darling::util::SpannedValue [−][src]
pub struct SpannedValue<T> { /* fields omitted */ }
Expand description
A value and an associated position in source code. The main use case for this is
to preserve position information to emit warnings from proc macros. You can use
a SpannedValue<T>
as a field in any struct that implements or derives any of
darling
’s core traits.
To access the underlying value, use the struct’s Deref
implementation.
Defaulting
This type is meant to be used in conjunction with attribute-extracted options,
but the user may not always explicitly set those options in their source code.
In this case, using Default::default()
will create an instance which points
to Span::call_site()
.
Implementations
Trait Implementations
Returns the “default value” for a type. Read more
Performs the conversion.
Create an instance from syn::DeriveInput
, or return an error.
Create an instance from a syn::Meta
by dispatching to the format-appropriate
trait function. This generally should not be overridden by implementers. Read more
Create an instance from the presence of the word in the attribute with no additional options specified. Read more
Create an instance from a list of nested meta items.
Create an instance from a literal value of either foo = "bar"
or foo("bar")
.
This dispatches to the appropriate method based on the type of literal encountered,
and generally should not be overridden by implementers. Read more
Create an instance from a char literal in a value position.
Create an instance from a string literal in a value position.
Create an instance from syn::Variant
, or return an error.
Returns a Span
covering the complete contents of this syntax tree
node, or Span::call_site()
if this node is empty. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for SpannedValue<T> where
T: RefUnwindSafe,
impl<T> !Send for SpannedValue<T>
impl<T> !Sync for SpannedValue<T>
impl<T> Unpin for SpannedValue<T> where
T: Unpin,
impl<T> UnwindSafe for SpannedValue<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more