pub enum NullCol {
Int(NullableColumn<i64>),
Float(NullableColumn<f64>),
Str(NullableColumn<String>),
Bool(NullableColumn<bool>),
}Expand description
A typed nullable column variant stored in a DataFrame column slot.
Phase 13-16 does not replace Column (which has no nulls) with NullCol
everywhere – that would be a breaking change across the whole codebase.
Instead, NullCol is used as the result type of operations that can
introduce nulls (left_join fills, pivot_wider missing combinations,
bind_rows on mismatched schemas, full_join unmatched rows).
Conversion: NullCol::from_column(col) wraps an existing Column as
fully-valid nullable. NullCol::to_column(nc) unwraps if fully valid,
else returns TidyError::Internal (caller must handle null columns
explicitly).
Variants§
Int(NullableColumn<i64>)
Float(NullableColumn<f64>)
Str(NullableColumn<String>)
Bool(NullableColumn<bool>)
Implementations§
Source§impl NullCol
impl NullCol
pub fn len(&self) -> usize
pub fn is_null(&self, i: usize) -> bool
pub fn type_name(&self) -> &'static str
Sourcepub fn from_column(col: &Column) -> Self
pub fn from_column(col: &Column) -> Self
Wrap a non-nullable Column as fully valid.
Sourcepub fn to_column_strict(&self) -> Result<Column, TidyError>
pub fn to_column_strict(&self) -> Result<Column, TidyError>
Unwrap to non-nullable Column only if all rows are valid (not null).
If any null exists, returns Err(TidyError::Internal).
Sourcepub fn to_column_filled(&self) -> Column
pub fn to_column_filled(&self) -> Column
Convert to Column, filling nulls with type-appropriate zero-value.
Null Int → 0, Null Float → NaN, Null Str → “”, Null Bool → false.
Sourcepub fn get_display(&self, i: usize) -> String
pub fn get_display(&self, i: usize) -> String
Get display string for a row (null → “null”).
Sourcepub fn null_of_type(type_name: &str, len: usize) -> Self
pub fn null_of_type(type_name: &str, len: usize) -> Self
Create a null-fill column of given type and length.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NullCol
impl RefUnwindSafe for NullCol
impl Send for NullCol
impl Sync for NullCol
impl Unpin for NullCol
impl UnsafeUnpin for NullCol
impl UnwindSafe for NullCol
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more