pub struct StructField {
pub name: String,
pub data_type: DataType,
pub options: Vec<Expression>,
pub comment: Option<String>,
}Expand description
Struct field with optional OPTIONS clause (BigQuery) and COMMENT (Spark/Databricks)
Fields§
§name: StringA raw field name, or a delimited identifier for compatibility with parsed ASTs. Parsed quoted names use double quotes with doubled internal quotes. An empty string denotes an anonymous field. Generation selects the target dialect’s quotes.
data_type: DataType§options: Vec<Expression>§comment: Option<String>Implementations§
Source§impl StructField
impl StructField
Sourcepub fn new(name: String, data_type: DataType) -> Self
pub fn new(name: String, data_type: DataType) -> Self
Create a new struct field without options
Sourcepub fn with_options(
name: String,
data_type: DataType,
options: Vec<Expression>,
) -> Self
pub fn with_options( name: String, data_type: DataType, options: Vec<Expression>, ) -> Self
Create a new struct field with options
Sourcepub fn with_options_and_comment(
name: String,
data_type: DataType,
options: Vec<Expression>,
comment: Option<String>,
) -> Self
pub fn with_options_and_comment( name: String, data_type: DataType, options: Vec<Expression>, comment: Option<String>, ) -> Self
Create a new struct field with options and comment
Trait Implementations§
Source§impl Clone for StructField
impl Clone for StructField
Source§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
Source§impl Serialize for StructField
impl Serialize for StructField
impl StructuralPartialEq 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