pub struct State {
pub rev: u64,
pub places: Vec<Entry>,
pub modes: Vec<ModeEntry>,
}Expand description
The stack: the place path, the active modes, a revision.
Fields§
§rev: u64Incremented by every transition.
places: Vec<Entry>The places from the root’s child to the top.
modes: Vec<ModeEntry>The active modes, at most one per group, in the order they came.
Implementations§
Source§impl State
impl State
Sourcepub fn is_on(&self, frame: &FrameId) -> bool
pub fn is_on(&self, frame: &FrameId) -> bool
Whether a frame is on (a place on the path or an active mode).
Sourcepub fn has_pushed(&self) -> bool
pub fn has_pushed(&self) -> bool
Whether a pushed mode is on (what nav.back pops first).
Sourcepub fn path_key(&self) -> String
pub fn path_key(&self) -> String
The place path as a key: root/demo.album/demo.photo, payloads
included when they are not null (demo.album=3).
Sourcepub fn projection_key(&self) -> String
pub fn projection_key(&self) -> String
The projection’s key: the path, then the active modes by group
(root/demo.album|orientation=demo.culling). A layout change made
in a mode belongs to this key, so leaving the mode reverts it.
Sourcepub fn layout_key(&self, registry: &FrameRegistry) -> String
pub fn layout_key(&self, registry: &FrameRegistry) -> String
The key a layout is kept under: the projection’s key, a place’s
payload left out unless its frame chooses its arrangement from it
(FrameSpec::arrangement_for). Another photo in the darkroom is
the same place for the layout (a panel detached there stays in its
window); a space whose payload picks its arrangement keeps one
layout per payload.
Sourcepub fn when_keys(&self, registry: &FrameRegistry) -> Vec<(String, String)>
pub fn when_keys(&self, registry: &FrameRegistry) -> Vec<(String, String)>
The context keys the stack sets: place, placeDepth,
modePushed, mode.<group> for every group of the registry (empty
when none is on), the keys of the top place and active modes, and
the top place’s payload (payload_keys).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for State
impl<'de> Deserialize<'de> for State
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<State, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<State, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for State
impl Serialize for State
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for State
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnsafeUnpin for State
impl UnwindSafe for State
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<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