Enum prql_compiler::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
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Declaration
impl Debug for Declaration
sourceimpl<'de> Deserialize<'de> for Declaration
impl<'de> Deserialize<'de> for Declaration
sourcefn 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
sourceimpl Display for Declaration
impl Display for Declaration
sourceimpl From<Declaration> for Error
impl From<Declaration> for Error
sourcefn from(dec: Declaration) -> Self
fn from(dec: Declaration) -> Self
Converts to this type from the input type.
sourceimpl Serialize for Declaration
impl Serialize for Declaration
Auto Trait Implementations
impl RefUnwindSafe for Declaration
impl Send for Declaration
impl Sync for Declaration
impl Unpin for Declaration
impl UnwindSafe for Declaration
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more