Crates.io | struct_scheme |
lib.rs | struct_scheme |
version | 0.0.3 |
source | src |
created_at | 2024-02-26 11:58:01.60278 |
updated_at | 2024-02-26 14:42:49.04142 |
description | structure scheme display |
homepage | |
repository | https://github.com/NodusLorden/struct_scheme |
max_upload_size | |
id | 1153474 |
size | 12,676 |
use struct_scheme::StructScheme;
use struct_scheme::TraitStructScheme;
#[derive(StructScheme)]
struct Car {
id: i32,
name: String
}
println!("{}", Car::get_scheme());
You can see:
DeriveInput {
attrs: [],
vis: Visibility::Inherited,
ident: Ident {
ident: "A",
span: #0 bytes(469..470),
},
generics: Generics {
lt_token: None,
params: [],
gt_token: None,
where_clause: None,
},
data: Data::Struct {
struct_token: Struct,
fields: Fields::Named {
brace_token: Brace,
named: [
Field {
attrs: [],
vis: Visibility::Inherited,
mutability: FieldMutability::
ident: Some(
Ident {
ident: "number",
span: #0 bytes(481..4
},
),
colon_token: Some(
Colon,
),
ty: Type::Path {
qself: None,
path: Path {
leading_colon: None,
segments: [
PathSegment {
ident: Ident
ident: "i
span: #0
},
arguments: Pa
},
],
},
},
},
Comma,
Field {
attrs: [],
vis: Visibility::Inherited,
mutability: FieldMutability::
ident: Some(
Ident {
ident: "text",
span: #0 bytes(502..5
},
),
colon_token: Some(
Colon,
),
ty: Type::Path {
qself: None,
path: Path {
leading_colon: None,
segments: [
PathSegment {
ident: Ident
ident: "S
span: #0
},
arguments: Pa
},
],
},
},
},
Comma,
],
},
semi_token: None,
},