polars_plan/dsl/
binary.rsuse super::*;
pub struct BinaryNameSpace(pub(crate) Expr);
impl BinaryNameSpace {
pub fn contains_literal(self, pat: Expr) -> Expr {
self.0.map_many_private(
FunctionExpr::BinaryExpr(BinaryFunction::Contains),
&[pat],
false,
Some(Default::default()),
)
}
pub fn ends_with(self, sub: Expr) -> Expr {
self.0.map_many_private(
FunctionExpr::BinaryExpr(BinaryFunction::EndsWith),
&[sub],
false,
Some(Default::default()),
)
}
pub fn starts_with(self, sub: Expr) -> Expr {
self.0.map_many_private(
FunctionExpr::BinaryExpr(BinaryFunction::StartsWith),
&[sub],
false,
Some(Default::default()),
)
}
pub fn size_bytes(self) -> Expr {
self.0
.map_private(FunctionExpr::BinaryExpr(BinaryFunction::Size))
}
#[cfg(feature = "binary_encoding")]
pub fn hex_decode(self, strict: bool) -> Expr {
self.0
.map_private(FunctionExpr::BinaryExpr(BinaryFunction::HexDecode(strict)))
}
#[cfg(feature = "binary_encoding")]
pub fn hex_encode(self) -> Expr {
self.0
.map_private(FunctionExpr::BinaryExpr(BinaryFunction::HexEncode))
}
#[cfg(feature = "binary_encoding")]
pub fn base64_decode(self, strict: bool) -> Expr {
self.0
.map_private(FunctionExpr::BinaryExpr(BinaryFunction::Base64Decode(
strict,
)))
}
#[cfg(feature = "binary_encoding")]
pub fn base64_encode(self) -> Expr {
self.0
.map_private(FunctionExpr::BinaryExpr(BinaryFunction::Base64Encode))
}
}