pub struct Dimension { /* private fields */ }Expand description
Represents a dimension in the cube
A dimension is a categorical attribute used for slicing and dicing data (e.g., date, region, product category).
Implementations§
Source§impl Dimension
impl Dimension
Sourcepub fn with_config(
name: impl Into<String>,
data_type: DataType,
nullable: bool,
cardinality: Option<usize>,
description: Option<String>,
) -> Self
pub fn with_config( name: impl Into<String>, data_type: DataType, nullable: bool, cardinality: Option<usize>, description: Option<String>, ) -> Self
Create a new dimension with full configuration
Sourcepub fn cardinality(&self) -> Option<usize>
pub fn cardinality(&self) -> Option<usize>
Get the cardinality
Sourcepub fn is_nullable(&self) -> bool
pub fn is_nullable(&self) -> bool
Check if the dimension is nullable
Sourcepub fn description(&self) -> Option<&str>
pub fn description(&self) -> Option<&str>
Get the description
Sourcepub fn set_cardinality(&mut self, cardinality: usize)
pub fn set_cardinality(&mut self, cardinality: usize)
Set the cardinality
Sourcepub fn set_description(&mut self, description: impl Into<String>)
pub fn set_description(&mut self, description: impl Into<String>)
Set the description
Sourcepub fn with_cardinality(self, cardinality: usize) -> Self
pub fn with_cardinality(self, cardinality: usize) -> Self
Builder-style: set cardinality
Sourcepub fn with_nullable(self, nullable: bool) -> Self
pub fn with_nullable(self, nullable: bool) -> Self
Builder-style: set nullable
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Builder-style: set description
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Dimension
impl<'de> Deserialize<'de> for Dimension
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 Dimension
Auto Trait Implementations§
impl Freeze for Dimension
impl RefUnwindSafe for Dimension
impl Send for Dimension
impl Sync for Dimension
impl Unpin for Dimension
impl UnwindSafe for Dimension
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
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>
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