pub struct Hierarchy { /* private fields */ }Expand description
Represents a hierarchy in the cube
A hierarchy defines a drill-down path through related dimensions (e.g., Year → Quarter → Month → Day for time-based analysis).
Implementations§
Source§impl Hierarchy
impl Hierarchy
Sourcepub fn with_config(
name: impl Into<String>,
levels: Vec<String>,
description: Option<String>,
) -> Self
pub fn with_config( name: impl Into<String>, levels: Vec<String>, description: Option<String>, ) -> Self
Create a new hierarchy with description
Sourcepub fn description(&self) -> Option<&str>
pub fn description(&self) -> Option<&str>
Get the description
Sourcepub fn level_at(&self, index: usize) -> Option<&str>
pub fn level_at(&self, index: usize) -> Option<&str>
Get a level by index (0 = coarsest, depth-1 = finest)
Sourcepub fn bottom_level(&self) -> Option<&str>
pub fn bottom_level(&self) -> Option<&str>
Get the finest (bottom) level
Sourcepub fn contains_level(&self, level: &str) -> bool
pub fn contains_level(&self, level: &str) -> bool
Check if a level exists in this hierarchy
Sourcepub fn ancestors_of(&self, level: &str) -> Vec<&str>
pub fn ancestors_of(&self, level: &str) -> Vec<&str>
Get all ancestor levels of a given level (from top to parent)
Sourcepub fn descendants_of(&self, level: &str) -> Vec<&str>
pub fn descendants_of(&self, level: &str) -> Vec<&str>
Get all descendant levels of a given level (from child to bottom)
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_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 Hierarchy
impl<'de> Deserialize<'de> for Hierarchy
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 Hierarchy
Auto Trait Implementations§
impl Freeze for Hierarchy
impl RefUnwindSafe for Hierarchy
impl Send for Hierarchy
impl Sync for Hierarchy
impl Unpin for Hierarchy
impl UnwindSafe for Hierarchy
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