Enum prqlc::ir::rq::RelationKind
source · pub enum RelationKind {
ExternRef(Ident),
Pipeline(Vec<Transform>),
Literal(RelationLiteral),
SString(Vec<InterpolateItem<Expr>>),
BuiltInFunction {
name: String,
args: Vec<Expr>,
},
}
Variants§
ExternRef(Ident)
Pipeline(Vec<Transform>)
Literal(RelationLiteral)
SString(Vec<InterpolateItem<Expr>>)
BuiltInFunction
Implementations§
source§impl RelationKind
impl RelationKind
sourcepub fn is_extern_ref(&self) -> bool
pub fn is_extern_ref(&self) -> bool
Returns true if this is a RelationKind::ExternRef
, otherwise false
sourcepub fn as_extern_ref_mut(&mut self) -> Option<&mut Ident>
pub fn as_extern_ref_mut(&mut self) -> Option<&mut Ident>
Optionally returns mutable references to the inner fields if this is a RelationKind::ExternRef
, otherwise None
sourcepub fn as_extern_ref(&self) -> Option<&Ident>
pub fn as_extern_ref(&self) -> Option<&Ident>
Optionally returns references to the inner fields if this is a RelationKind::ExternRef
, otherwise None
sourcepub fn into_extern_ref(self) -> Result<Ident, Self>
pub fn into_extern_ref(self) -> Result<Ident, Self>
Returns the inner fields if this is a RelationKind::ExternRef
, otherwise returns back the enum in the Err
case of the result
sourcepub fn is_pipeline(&self) -> bool
pub fn is_pipeline(&self) -> bool
Returns true if this is a RelationKind::Pipeline
, otherwise false
sourcepub fn as_pipeline_mut(&mut self) -> Option<&mut Vec<Transform>>
pub fn as_pipeline_mut(&mut self) -> Option<&mut Vec<Transform>>
Optionally returns mutable references to the inner fields if this is a RelationKind::Pipeline
, otherwise None
sourcepub fn as_pipeline(&self) -> Option<&Vec<Transform>>
pub fn as_pipeline(&self) -> Option<&Vec<Transform>>
Optionally returns references to the inner fields if this is a RelationKind::Pipeline
, otherwise None
sourcepub fn into_pipeline(self) -> Result<Vec<Transform>, Self>
pub fn into_pipeline(self) -> Result<Vec<Transform>, Self>
Returns the inner fields if this is a RelationKind::Pipeline
, otherwise returns back the enum in the Err
case of the result
sourcepub fn is_literal(&self) -> bool
pub fn is_literal(&self) -> bool
Returns true if this is a RelationKind::Literal
, otherwise false
sourcepub fn as_literal_mut(&mut self) -> Option<&mut RelationLiteral>
pub fn as_literal_mut(&mut self) -> Option<&mut RelationLiteral>
Optionally returns mutable references to the inner fields if this is a RelationKind::Literal
, otherwise None
sourcepub fn as_literal(&self) -> Option<&RelationLiteral>
pub fn as_literal(&self) -> Option<&RelationLiteral>
Optionally returns references to the inner fields if this is a RelationKind::Literal
, otherwise None
sourcepub fn into_literal(self) -> Result<RelationLiteral, Self>
pub fn into_literal(self) -> Result<RelationLiteral, Self>
Returns the inner fields if this is a RelationKind::Literal
, otherwise returns back the enum in the Err
case of the result
sourcepub fn is_s_string(&self) -> bool
pub fn is_s_string(&self) -> bool
Returns true if this is a RelationKind::SString
, otherwise false
sourcepub fn as_s_string_mut(&mut self) -> Option<&mut Vec<InterpolateItem<Expr>>>
pub fn as_s_string_mut(&mut self) -> Option<&mut Vec<InterpolateItem<Expr>>>
Optionally returns mutable references to the inner fields if this is a RelationKind::SString
, otherwise None
sourcepub fn as_s_string(&self) -> Option<&Vec<InterpolateItem<Expr>>>
pub fn as_s_string(&self) -> Option<&Vec<InterpolateItem<Expr>>>
Optionally returns references to the inner fields if this is a RelationKind::SString
, otherwise None
sourcepub fn into_s_string(self) -> Result<Vec<InterpolateItem<Expr>>, Self>
pub fn into_s_string(self) -> Result<Vec<InterpolateItem<Expr>>, Self>
Returns the inner fields if this is a RelationKind::SString
, otherwise returns back the enum in the Err
case of the result
sourcepub fn is_built_in_function(&self) -> bool
pub fn is_built_in_function(&self) -> bool
Returns true if this is a RelationKind::BuiltInFunction
, otherwise false
sourcepub fn as_built_in_function_mut(
&mut self
) -> Option<(&mut String, &mut Vec<Expr>)>
pub fn as_built_in_function_mut( &mut self ) -> Option<(&mut String, &mut Vec<Expr>)>
Optionally returns mutable references to the inner fields if this is a RelationKind::BuiltInFunction
, otherwise None
Trait Implementations§
source§impl Clone for RelationKind
impl Clone for RelationKind
source§fn clone(&self) -> RelationKind
fn clone(&self) -> RelationKind
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for RelationKind
impl Debug for RelationKind
source§impl<'de> Deserialize<'de> for RelationKind
impl<'de> Deserialize<'de> for RelationKind
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 RelationKind
impl PartialEq for RelationKind
source§fn eq(&self, other: &RelationKind) -> bool
fn eq(&self, other: &RelationKind) -> bool
self
and other
values to be equal, and is used
by ==
.