#[non_exhaustive]pub struct LayoutExpansion { /* private fields */ }Expand description
The saved expansion of groups: the default depth, and the groups the
user toggled against it. A toggled group is its key values from the top
level down, one per level of the layout’s group_by; the levels name the
columns, so a path holds values only.
Serialized as {"depth": "all", "toggled": [["AAPL"], ["MSFT", "Sell"]]}.
depth is "all", "captions" or the number of expanded levels
(ExpandDepth); a value is written as an OwnedValue is, so 12
reads back as an integer and 12.0 as a float. toggled is not written
when it is empty. JSON has no NaN or infinity: a path with one is not
written, and that group’s toggle is not saved.
Reading drops a path with a value this build cannot hold, such as a
decimal without the decimal feature or a kind of value a newer build
added, and keeps the rest of the layout; the grid’s
LayoutReport::dropped_expansion counts it. Tree rows are not saved:
their keys are the application’s own type.
Implementations§
Source§impl LayoutExpansion
impl LayoutExpansion
Sourcepub fn new(depth: ExpandDepth) -> Self
pub fn new(depth: ExpandDepth) -> Self
depth, with no group toggled.
Sourcepub fn with_toggled(self, path: impl IntoIterator<Item = OwnedValue>) -> Self
pub fn with_toggled(self, path: impl IntoIterator<Item = OwnedValue>) -> Self
Adds a group toggled against the depth: its key values, the top level first.
Sourcepub fn depth(&self) -> ExpandDepth
pub fn depth(&self) -> ExpandDepth
The default depth.
Sourcepub fn toggled(&self) -> &[Vec<OwnedValue>]
pub fn toggled(&self) -> &[Vec<OwnedValue>]
The toggled groups in saved order, each as its key values from the top level down.
Sourcepub fn is_default(&self) -> bool
pub fn is_default(&self) -> bool
Returns true for the default: every group expanded, none toggled.
Trait Implementations§
Source§impl Clone for LayoutExpansion
impl Clone for LayoutExpansion
Source§fn clone(&self) -> LayoutExpansion
fn clone(&self) -> LayoutExpansion
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LayoutExpansion
impl Debug for LayoutExpansion
Source§impl Default for LayoutExpansion
impl Default for LayoutExpansion
Source§fn default() -> LayoutExpansion
fn default() -> LayoutExpansion
Source§impl<'de> Deserialize<'de> for LayoutExpansion
impl<'de> Deserialize<'de> for LayoutExpansion
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>,
Source§impl PartialEq for LayoutExpansion
impl PartialEq for LayoutExpansion
Source§impl Serialize for LayoutExpansion
impl Serialize for LayoutExpansion
impl Eq for LayoutExpansion
impl StructuralPartialEq for LayoutExpansion
Auto Trait Implementations§
impl Freeze for LayoutExpansion
impl !RefUnwindSafe for LayoutExpansion
impl Send for LayoutExpansion
impl Sync for LayoutExpansion
impl Unpin for LayoutExpansion
impl UnsafeUnpin for LayoutExpansion
impl !UnwindSafe for LayoutExpansion
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().