pub struct FieldDef {
pub name: String,
pub ty: TypeKind,
pub optional: bool,
pub rename: Option<String>,
pub doc: Option<String>,
pub skip: bool,
pub flatten: bool,
pub type_override: Option<String>,
}Expand description
Re-export core types for advanced usage. A single field inside a struct.
Fields§
§name: StringThe original Rust field name
ty: TypeKindThe type of this field in the IR
optional: boolWhether this field is optional (Option<T> or #[tw(optional)])
rename: Option<String>Renamed field name from #[serde(rename = "x")] or #[tw(rename = "x")]
doc: Option<String>Documentation comment from /// doc comments
skip: boolWhether to skip this field in generated output (#[tw(skip)] or #[serde(skip)])
flatten: boolWhether this field is flattened (#[serde(flatten)])
type_override: Option<String>Override the generated type string via #[tw(type = "X")]
Trait Implementations§
impl StructuralPartialEq for FieldDef
Auto Trait Implementations§
impl Freeze for FieldDef
impl RefUnwindSafe for FieldDef
impl Send for FieldDef
impl Sync for FieldDef
impl Unpin for FieldDef
impl UnsafeUnpin for FieldDef
impl UnwindSafe for FieldDef
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