Enum prql_compiler::semantic::Declaration
source · [−]pub enum Declaration {
Expression(Box<Node>),
ExternRef {
table: Option<usize>,
variable: String,
},
Table(String),
Function(FuncDef),
}
Variants
Expression(Box<Node>)
ExternRef
Fields
table: Option<usize>
Table can be None if we are unable to determine from which table this column is from.
variable: String
Full identifier when table is None, only variable name when table is known.
Table(String)
Function(FuncDef)
Implementations
sourceimpl Declaration
impl Declaration
sourcepub fn as_expression_mut(&mut self) -> Option<&mut Box<Node>>
pub fn as_expression_mut(&mut self) -> Option<&mut Box<Node>>
Optionally returns mutable references to the inner fields if this is a Declaration::Expression
, otherwise None
sourcepub fn as_expression(&self) -> Option<&Box<Node>>
pub fn as_expression(&self) -> Option<&Box<Node>>
Optionally returns references to the inner fields if this is a Declaration::Expression
, otherwise None
sourcepub fn into_expression(self) -> Result<Box<Node>, Self>
pub fn into_expression(self) -> Result<Box<Node>, Self>
Returns the inner fields if this is a Declaration::Expression
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_extern_ref_mut(&mut self) -> Option<(&mut Option<usize>, &mut String)>
pub fn as_extern_ref_mut(&mut self) -> Option<(&mut Option<usize>, &mut String)>
Optionally returns mutable references to the inner fields if this is a Declaration::ExternRef
, otherwise None
sourcepub fn as_extern_ref(&self) -> Option<(&Option<usize>, &String)>
pub fn as_extern_ref(&self) -> Option<(&Option<usize>, &String)>
Optionally returns references to the inner fields if this is a Declaration::ExternRef
, otherwise None
sourcepub fn into_extern_ref(self) -> Result<(Option<usize>, String), Self>
pub fn into_extern_ref(self) -> Result<(Option<usize>, String), Self>
Returns the inner fields if this is a Declaration::ExternRef
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_table_mut(&mut self) -> Option<&mut String>
pub fn as_table_mut(&mut self) -> Option<&mut String>
Optionally returns mutable references to the inner fields if this is a Declaration::Table
, otherwise None
sourcepub fn as_table(&self) -> Option<&String>
pub fn as_table(&self) -> Option<&String>
Optionally returns references to the inner fields if this is a Declaration::Table
, otherwise None
sourcepub fn into_table(self) -> Result<String, Self>
pub fn into_table(self) -> Result<String, Self>
Returns the inner fields if this is a Declaration::Table
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_function_mut(&mut self) -> Option<&mut FuncDef>
pub fn as_function_mut(&mut self) -> Option<&mut FuncDef>
Optionally returns mutable references to the inner fields if this is a Declaration::Function
, otherwise None
sourcepub fn as_function(&self) -> Option<&FuncDef>
pub fn as_function(&self) -> Option<&FuncDef>
Optionally returns references to the inner fields if this is a Declaration::Function
, otherwise None
sourcepub fn into_function(self) -> Result<FuncDef, Self>
pub fn into_function(self) -> Result<FuncDef, Self>
Returns the inner fields if this is a Declaration::Function
, otherwise returns back the enum in the Err
case of the result
Trait Implementations
sourceimpl Clone for Declaration
impl Clone for Declaration
sourcefn clone(&self) -> Declaration
fn clone(&self) -> Declaration
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more