pub struct FieldDef {
pub name: String,
pub ty: TypeRef,
pub optional: bool,
pub default: Option<String>,
pub doc: String,
pub sanitized: bool,
pub is_boxed: bool,
pub type_rust_path: Option<String>,
pub cfg: Option<String>,
pub typed_default: Option<DefaultValue>,
}Expand description
A field on a public struct.
Fields§
§name: String§ty: TypeRef§optional: bool§default: Option<String>§doc: String§sanitized: boolTrue if this field’s type was sanitized (e.g., Duration→u64, trait object→String). Fields marked sanitized cannot participate in auto-generated From/Into conversions.
is_boxed: boolTrue if the core field type is Box<T> (or Option<Box<T>>).
Used by FFI backends to insert proper deref when cloning field values.
type_rust_path: Option<String>Fully qualified Rust path for the field’s type (e.g. my_crate::types::OutputFormat).
Used by backends to disambiguate types with the same short name.
cfg: Option<String>#[cfg(...)] condition string on this field, if any.
Used by backends to conditionally include fields in struct literals.
typed_default: Option<DefaultValue>Typed default value for language-native default emission.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FieldDef
impl<'de> Deserialize<'de> for FieldDef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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