polars_plan/dsl/function_expr/
pow.rs1use super::*;
2
3#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4#[cfg_attr(feature = "dsl-schema", derive(schemars::JsonSchema))]
5#[derive(Clone, Copy, PartialEq, Debug, Eq, Hash)]
6pub enum PowFunction {
7 Generic,
8 Sqrt,
9 Cbrt,
10}
11
12impl Display for PowFunction {
13 fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
14 use self::*;
15 match self {
16 PowFunction::Generic => write!(f, "pow"),
17 PowFunction::Sqrt => write!(f, "sqrt"),
18 PowFunction::Cbrt => write!(f, "cbrt"),
19 }
20 }
21}
22
23impl From<PowFunction> for FunctionExpr {
24 fn from(value: PowFunction) -> Self {
25 Self::Pow(value)
26 }
27}