use crate::column::Column;
use crate::error::{CudfError, Result};
use crate::types::DataType;
impl Column {
pub fn str_to_integers(&self, dtype: DataType) -> Result<Column> {
let result =
cudf_cxx::strings::convert::ffi::str_to_integers(&self.inner, dtype.id() as i32)
.map_err(CudfError::from_cxx)?;
Ok(Column { inner: result })
}
pub fn str_from_integers(&self) -> Result<Column> {
let result = cudf_cxx::strings::convert::ffi::str_from_integers(&self.inner)
.map_err(CudfError::from_cxx)?;
Ok(Column { inner: result })
}
pub fn str_to_floats(&self, dtype: DataType) -> Result<Column> {
let result = cudf_cxx::strings::convert::ffi::str_to_floats(&self.inner, dtype.id() as i32)
.map_err(CudfError::from_cxx)?;
Ok(Column { inner: result })
}
pub fn str_from_floats(&self) -> Result<Column> {
let result = cudf_cxx::strings::convert::ffi::str_from_floats(&self.inner)
.map_err(CudfError::from_cxx)?;
Ok(Column { inner: result })
}
pub fn str_to_booleans(&self, true_str: &str) -> Result<Column> {
let result = cudf_cxx::strings::convert::ffi::str_to_booleans(&self.inner, true_str)
.map_err(CudfError::from_cxx)?;
Ok(Column { inner: result })
}
pub fn str_from_booleans(&self, true_str: &str, false_str: &str) -> Result<Column> {
let result =
cudf_cxx::strings::convert::ffi::str_from_booleans(&self.inner, true_str, false_str)
.map_err(CudfError::from_cxx)?;
Ok(Column { inner: result })
}
pub fn str_to_timestamps(&self, format: &str, dtype: DataType) -> Result<Column> {
let result = cudf_cxx::strings::convert::ffi::str_to_timestamps(
&self.inner,
format,
dtype.id() as i32,
)
.map_err(CudfError::from_cxx)?;
Ok(Column { inner: result })
}
pub fn str_from_timestamps(&self, format: &str) -> Result<Column> {
let result = cudf_cxx::strings::convert::ffi::str_from_timestamps(&self.inner, format)
.map_err(CudfError::from_cxx)?;
Ok(Column { inner: result })
}
pub fn str_to_durations(&self, format: &str, dtype: DataType) -> Result<Column> {
let result = cudf_cxx::strings::convert::ffi::str_to_durations(
&self.inner,
format,
dtype.id() as i32,
)
.map_err(CudfError::from_cxx)?;
Ok(Column { inner: result })
}
pub fn str_from_durations(&self, format: &str) -> Result<Column> {
let result = cudf_cxx::strings::convert::ffi::str_from_durations(&self.inner, format)
.map_err(CudfError::from_cxx)?;
Ok(Column { inner: result })
}
pub fn str_to_fixed_point(&self, dtype: DataType, scale: i32) -> Result<Column> {
let result = cudf_cxx::strings::convert::ffi::str_to_fixed_point(
&self.inner,
dtype.id() as i32,
scale,
)
.map_err(CudfError::from_cxx)?;
Ok(Column { inner: result })
}
pub fn str_from_fixed_point(&self) -> Result<Column> {
let result = cudf_cxx::strings::convert::ffi::str_from_fixed_point(&self.inner)
.map_err(CudfError::from_cxx)?;
Ok(Column { inner: result })
}
pub fn str_is_integer(&self) -> Result<Column> {
let result = cudf_cxx::strings::convert::ffi::str_is_integer(&self.inner)
.map_err(CudfError::from_cxx)?;
Ok(Column { inner: result })
}
pub fn str_is_float(&self) -> Result<Column> {
let result = cudf_cxx::strings::convert::ffi::str_is_float(&self.inner)
.map_err(CudfError::from_cxx)?;
Ok(Column { inner: result })
}
pub fn str_hex_to_integers(&self, dtype: DataType) -> Result<Column> {
let result =
cudf_cxx::strings::convert::ffi::str_hex_to_integers(&self.inner, dtype.id() as i32)
.map_err(CudfError::from_cxx)?;
Ok(Column { inner: result })
}
pub fn str_integers_to_hex(&self) -> Result<Column> {
let result = cudf_cxx::strings::convert::ffi::str_integers_to_hex(&self.inner)
.map_err(CudfError::from_cxx)?;
Ok(Column { inner: result })
}
pub fn str_ipv4_to_integers(&self) -> Result<Column> {
let result = cudf_cxx::strings::convert::ffi::str_ipv4_to_integers(&self.inner)
.map_err(CudfError::from_cxx)?;
Ok(Column { inner: result })
}
pub fn str_integers_to_ipv4(&self) -> Result<Column> {
let result = cudf_cxx::strings::convert::ffi::str_integers_to_ipv4(&self.inner)
.map_err(CudfError::from_cxx)?;
Ok(Column { inner: result })
}
pub fn str_url_encode(&self) -> Result<Column> {
let result = cudf_cxx::strings::convert::ffi::str_url_encode(&self.inner)
.map_err(CudfError::from_cxx)?;
Ok(Column { inner: result })
}
pub fn str_url_decode(&self) -> Result<Column> {
let result = cudf_cxx::strings::convert::ffi::str_url_decode(&self.inner)
.map_err(CudfError::from_cxx)?;
Ok(Column { inner: result })
}
pub fn str_is_fixed_point(&self, dtype: DataType) -> Result<Column> {
let result =
cudf_cxx::strings::convert::ffi::str_is_fixed_point(&self.inner, dtype.id() as i32)
.map_err(CudfError::from_cxx)?;
Ok(Column { inner: result })
}
pub fn str_cast_to_integer(&self, dtype: DataType) -> Result<Column> {
let result =
cudf_cxx::strings::convert::ffi::str_cast_to_integer(&self.inner, dtype.id() as i32)
.map_err(CudfError::from_cxx)?;
Ok(Column { inner: result })
}
pub fn str_cast_from_integer(&self) -> Result<Column> {
let result = cudf_cxx::strings::convert::ffi::str_cast_from_integer(&self.inner)
.map_err(CudfError::from_cxx)?;
Ok(Column { inner: result })
}
pub fn str_format_list_column(&self) -> Result<Column> {
let result = cudf_cxx::strings::convert::ffi::str_format_list_column(&self.inner)
.map_err(CudfError::from_cxx)?;
Ok(Column { inner: result })
}
pub fn str_is_timestamp(&self, format: &str) -> Result<Column> {
let result = cudf_cxx::strings::convert::ffi::str_is_timestamp(&self.inner, format)
.map_err(CudfError::from_cxx)?;
Ok(Column { inner: result })
}
pub fn str_is_hex(&self) -> Result<Column> {
let result = cudf_cxx::strings::convert::ffi::str_is_hex(&self.inner)
.map_err(CudfError::from_cxx)?;
Ok(Column { inner: result })
}
pub fn str_is_ipv4(&self) -> Result<Column> {
let result = cudf_cxx::strings::convert::ffi::str_is_ipv4(&self.inner)
.map_err(CudfError::from_cxx)?;
Ok(Column { inner: result })
}
}