pub struct SynArgs {
pub value: Value,
}
Expand description
A very important core type used to convert types related to syn::parse into Value, and then you can call the .arguments
method to get the specific type (this type must be derived using the ArgsParse
macro)
Example:
use syn_args::def;
use syn_args::derive::ArgsParse;
use syn_args::SynArgs;
#[derive(Debug, ArgsParse)]
enum FArgs {
F1(def::Int),
F2(def::String),
}
fn main() {
let args = syn::parse_str::<SynArgs>("F(1)").unwrap();
let args = args.arguments::<FArgs>().unwrap();
println!("{:?}", args);
}
Fields§
§value: Value
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SynArgs
impl RefUnwindSafe for SynArgs
impl !Send for SynArgs
impl !Sync for SynArgs
impl Unpin for SynArgs
impl UnwindSafe for SynArgs
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