#[non_exhaustive]pub struct Column {
pub name: String,
pub values: ColumnValues,
pub validity: Option<Vec<bool>>,
pub unit: Option<String>,
pub metadata: BTreeMap<String, String>,
}Available on crate feature
data only.Expand description
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringColumn name.
values: ColumnValuesStorage and type.
validity: Option<Vec<bool>>A false entry marks a null cell. None means every cell is valid.
unit: Option<String>Unit text, such as V or s.
metadata: BTreeMap<String, String>Free-form metadata (source, precision, labels).
Implementations§
Source§impl Column
impl Column
Sourcepub fn new(name: impl Into<String>, values: ColumnValues) -> Self
pub fn new(name: impl Into<String>, values: ColumnValues) -> Self
A column from storage.
Sourcepub fn bools(name: impl Into<String>, values: impl Into<Arc<[bool]>>) -> Self
pub fn bools(name: impl Into<String>, values: impl Into<Arc<[bool]>>) -> Self
A boolean column.
Sourcepub fn text(
name: impl Into<String>,
values: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn text( name: impl Into<String>, values: impl IntoIterator<Item = impl Into<String>>, ) -> Self
A text column.
Sourcepub fn dates(name: impl Into<String>, values: impl Into<Arc<[i64]>>) -> Self
pub fn dates(name: impl Into<String>, values: impl Into<Arc<[i64]>>) -> Self
A date column (days since the Unix epoch).
Sourcepub fn times(name: impl Into<String>, values: impl Into<Arc<[i64]>>) -> Self
pub fn times(name: impl Into<String>, values: impl Into<Arc<[i64]>>) -> Self
A time column (nanoseconds since the Unix epoch).
Sourcepub fn categories(
name: impl Into<String>,
values: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn categories( name: impl Into<String>, values: impl IntoIterator<Item = impl Into<String>>, ) -> Self
A category column.
Sourcepub fn with_metadata(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_metadata( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add metadata.
Sourcepub fn with_validity(self, validity: impl IntoIterator<Item = bool>) -> Self
pub fn with_validity(self, validity: impl IntoIterator<Item = bool>) -> Self
Set the validity mask. A shorter mask marks trailing cells invalid.
Sourcepub fn kind(&self) -> ColumnType
pub fn kind(&self) -> ColumnType
The type.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Column
impl<'de> Deserialize<'de> for Column
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Column
Auto Trait Implementations§
impl Forget for Column
impl Freeze for Columnwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const ArcInner<[f64]> is !null: Freeze,
PhantomData<ArcInner<[f64]>>: Freeze,
*const ArcInner<[i64]> is !null: Freeze,
PhantomData<ArcInner<[i64]>>: Freeze,
*const ArcInner<[bool]> is !null: Freeze,
PhantomData<ArcInner<[bool]>>: Freeze,
*const ArcInner<[String]> is !null: Freeze,
PhantomData<ArcInner<[String]>>: Freeze,
PhantomData<bool>: Freeze,
*const LeafNode<String, String> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, String)>>: Freeze,
impl Move for Column
impl RefUnwindSafe for Column
impl Send for Column
impl Sync for Column
impl Unpin for Column
impl UnsafeUnpin for Columnwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<[f64]> is !null: UnsafeUnpin,
PhantomData<ArcInner<[f64]>>: UnsafeUnpin,
*const ArcInner<[i64]> is !null: UnsafeUnpin,
PhantomData<ArcInner<[i64]>>: UnsafeUnpin,
*const ArcInner<[bool]> is !null: UnsafeUnpin,
PhantomData<ArcInner<[bool]>>: UnsafeUnpin,
*const ArcInner<[String]> is !null: UnsafeUnpin,
PhantomData<ArcInner<[String]>>: UnsafeUnpin,
PhantomData<bool>: UnsafeUnpin,
*const LeafNode<String, String> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, String)>>: UnsafeUnpin,
impl UnwindSafe for Columnwhere
RawVecInner: UnwindSafe,
Arc<[f64]>: UnwindSafe,
Arc<[i64]>: UnwindSafe,
Arc<[bool]>: UnwindSafe,
Arc<[String]>: UnwindSafe,
BTreeMap<String, String>: UnwindSafe,
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
Converts
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> ⓘ
Converts
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