Enum prqlc_ast::TupleField
source · pub enum TupleField {
Single(Option<String>, Option<Ty>),
Wildcard(Option<Ty>),
}
Variants§
Single(Option<String>, Option<Ty>)
Named tuple element.
Wildcard(Option<Ty>)
Placeholder for possibly many elements. Means “and other unmentioned columns”. Does not mean “all columns”.
Implementations§
source§impl TupleField
impl TupleField
sourcepub fn as_single_mut(
&mut self
) -> Option<(&mut Option<String>, &mut Option<Ty>)>
pub fn as_single_mut( &mut self ) -> Option<(&mut Option<String>, &mut Option<Ty>)>
Optionally returns mutable references to the inner fields if this is a TupleField::Single
, otherwise None
sourcepub fn as_single(&self) -> Option<(&Option<String>, &Option<Ty>)>
pub fn as_single(&self) -> Option<(&Option<String>, &Option<Ty>)>
Optionally returns references to the inner fields if this is a TupleField::Single
, otherwise None
sourcepub fn into_single(self) -> Result<(Option<String>, Option<Ty>), Self>
pub fn into_single(self) -> Result<(Option<String>, Option<Ty>), Self>
Returns the inner fields if this is a TupleField::Single
, otherwise returns back the enum in the Err
case of the result
sourcepub fn is_wildcard(&self) -> bool
pub fn is_wildcard(&self) -> bool
Returns true if this is a TupleField::Wildcard
, otherwise false
sourcepub fn as_wildcard_mut(&mut self) -> Option<&mut Option<Ty>>
pub fn as_wildcard_mut(&mut self) -> Option<&mut Option<Ty>>
Optionally returns mutable references to the inner fields if this is a TupleField::Wildcard
, otherwise None
sourcepub fn as_wildcard(&self) -> Option<&Option<Ty>>
pub fn as_wildcard(&self) -> Option<&Option<Ty>>
Optionally returns references to the inner fields if this is a TupleField::Wildcard
, otherwise None
sourcepub fn into_wildcard(self) -> Result<Option<Ty>, Self>
pub fn into_wildcard(self) -> Result<Option<Ty>, Self>
Returns the inner fields if this is a TupleField::Wildcard
, otherwise returns back the enum in the Err
case of the result
Trait Implementations§
source§impl Clone for TupleField
impl Clone for TupleField
source§fn clone(&self) -> TupleField
fn clone(&self) -> TupleField
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TupleField
impl Debug for TupleField
source§impl<'de> Deserialize<'de> for TupleField
impl<'de> Deserialize<'de> for TupleField
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>,
source§impl PartialEq for TupleField
impl PartialEq for TupleField
source§fn eq(&self, other: &TupleField) -> bool
fn eq(&self, other: &TupleField) -> bool
self
and other
values to be equal, and is used
by ==
.