pub struct Measure { /* private fields */ }Expand description
Represents a measure in the cube
A measure is a numeric value that can be aggregated (e.g., sales amount, quantity, revenue).
Implementations§
Source§impl Measure
 
impl Measure
Sourcepub fn new(
    name: impl Into<String>,
    data_type: DataType,
    default_agg: AggFunc,
) -> Self
 
pub fn new( name: impl Into<String>, data_type: DataType, default_agg: AggFunc, ) -> Self
Create a new measure with a default aggregation function
Sourcepub fn with_config(
    name: impl Into<String>,
    data_type: DataType,
    default_agg: AggFunc,
    nullable: bool,
    description: Option<String>,
    format: Option<String>,
) -> Self
 
pub fn with_config( name: impl Into<String>, data_type: DataType, default_agg: AggFunc, nullable: bool, description: Option<String>, format: Option<String>, ) -> Self
Create a new measure with full configuration
Sourcepub fn default_agg(&self) -> AggFunc
 
pub fn default_agg(&self) -> AggFunc
Get the default aggregation function
Sourcepub fn is_nullable(&self) -> bool
 
pub fn is_nullable(&self) -> bool
Check if the measure is nullable
Sourcepub fn description(&self) -> Option<&str>
 
pub fn description(&self) -> Option<&str>
Get the description
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 set_format(&mut self, format: impl Into<String>)
 
pub fn set_format(&mut self, format: impl Into<String>)
Set the format
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
Sourcepub fn with_format(self, format: impl Into<String>) -> Self
 
pub fn with_format(self, format: impl Into<String>) -> Self
Builder-style: set format
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Measure
 
impl<'de> Deserialize<'de> for Measure
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 Measure
Auto Trait Implementations§
impl Freeze for Measure
impl RefUnwindSafe for Measure
impl Send for Measure
impl Sync for Measure
impl Unpin for Measure
impl UnwindSafe for Measure
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