Struct polars_plan::dsl::FieldsMapper
source · pub struct FieldsMapper<'a> { /* private fields */ }
Implementations§
source§impl<'a> FieldsMapper<'a>
impl<'a> FieldsMapper<'a>
pub fn new(fields: &'a [Field]) -> Self
sourcepub fn with_same_dtype(&self) -> PolarsResult<Field>
pub fn with_same_dtype(&self) -> PolarsResult<Field>
Field with the same dtype.
sourcepub fn with_dtype(&self, dtype: DataType) -> PolarsResult<Field>
pub fn with_dtype(&self, dtype: DataType) -> PolarsResult<Field>
Set a dtype.
sourcepub fn map_dtype(
&self,
func: impl FnOnce(&DataType) -> DataType
) -> PolarsResult<Field>
pub fn map_dtype( &self, func: impl FnOnce(&DataType) -> DataType ) -> PolarsResult<Field>
Map a single dtype.
pub fn get_fields_lens(&self) -> usize
sourcepub fn try_map_field(
&self,
func: impl FnOnce(&Field) -> PolarsResult<Field>
) -> PolarsResult<Field>
pub fn try_map_field( &self, func: impl FnOnce(&Field) -> PolarsResult<Field> ) -> PolarsResult<Field>
Map a single field with a potentially failing mapper function.
sourcepub fn map_to_float_dtype(&self) -> PolarsResult<Field>
pub fn map_to_float_dtype(&self) -> PolarsResult<Field>
Map to a float supertype.
sourcepub fn map_numeric_to_float_dtype(&self) -> PolarsResult<Field>
pub fn map_numeric_to_float_dtype(&self) -> PolarsResult<Field>
Map to a float supertype if numeric, else preserve
sourcepub fn to_physical_type(&self) -> PolarsResult<Field>
pub fn to_physical_type(&self) -> PolarsResult<Field>
Map to a physical type.
sourcepub fn try_map_dtype(
&self,
func: impl FnOnce(&DataType) -> PolarsResult<DataType>
) -> PolarsResult<Field>
pub fn try_map_dtype( &self, func: impl FnOnce(&DataType) -> PolarsResult<DataType> ) -> PolarsResult<Field>
Map a single dtype with a potentially failing mapper function.
sourcepub fn try_map_dtypes(
&self,
func: impl FnOnce(&[&DataType]) -> PolarsResult<DataType>
) -> PolarsResult<Field>
pub fn try_map_dtypes( &self, func: impl FnOnce(&[&DataType]) -> PolarsResult<DataType> ) -> PolarsResult<Field>
Map all dtypes with a potentially failing mapper function.
sourcepub fn map_to_supertype(&self) -> PolarsResult<Field>
pub fn map_to_supertype(&self) -> PolarsResult<Field>
Map the dtype to the “supertype” of all fields.
sourcepub fn map_to_list_and_array_inner_dtype(&self) -> PolarsResult<Field>
pub fn map_to_list_and_array_inner_dtype(&self) -> PolarsResult<Field>
Map the dtype to the dtype of the list/array elements.
sourcepub fn map_to_list_supertype(&self) -> PolarsResult<Field>
pub fn map_to_list_supertype(&self) -> PolarsResult<Field>
Map the dtypes to the “supertype” of a list of lists.
sourcepub fn map_datetime_dtype_timezone(
&self,
tz: Option<&TimeZone>
) -> PolarsResult<Field>
Available on crate feature timezones
only.
pub fn map_datetime_dtype_timezone( &self, tz: Option<&TimeZone> ) -> PolarsResult<Field>
timezones
only.Set the timezone of a datetime dtype.
pub fn nested_sum_type(&self) -> PolarsResult<Field>
pub fn replace_dtype( &self, return_dtype: Option<DataType> ) -> PolarsResult<Field>
Available on crate feature
replace
only.Auto Trait Implementations§
impl<'a> Freeze for FieldsMapper<'a>
impl<'a> !RefUnwindSafe for FieldsMapper<'a>
impl<'a> Send for FieldsMapper<'a>
impl<'a> Sync for FieldsMapper<'a>
impl<'a> Unpin for FieldsMapper<'a>
impl<'a> !UnwindSafe for FieldsMapper<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more