pub struct StructField {
pub annotations: Vec<Annotation>,
pub is_comptime: bool,
pub name: String,
pub span: Span,
pub doc_comment: Option<DocComment>,
pub type_annotation: TypeAnnotation,
pub default_value: Option<Expr>,
}Expand description
A field in a struct type definition
Comptime fields are type-level constants baked at compile time. They occupy zero runtime slots (no ValueSlot in TypedObject). Access resolves to a constant push at compile time.
type Currency {
comptime symbol: string = "$",
comptime decimals: number = 2,
amount: number,
}Fields§
§annotations: Vec<Annotation>§is_comptime: bool§name: String§span: Span§doc_comment: Option<DocComment>§type_annotation: TypeAnnotation§default_value: Option<Expr>Trait Implementations§
Source§impl Clone for StructField
impl Clone for StructField
Source§fn clone(&self) -> StructField
fn clone(&self) -> StructField
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StructField
impl Debug for StructField
Source§impl<'de> Deserialize<'de> for StructField
impl<'de> Deserialize<'de> for StructField
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
Source§impl PartialEq for StructField
impl PartialEq for StructField
Auto Trait Implementations§
impl Freeze for StructField
impl RefUnwindSafe for StructField
impl Send for StructField
impl Sync for StructField
impl Unpin for StructField
impl UnsafeUnpin for StructField
impl UnwindSafe for StructField
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