Skip to main content

State

Struct State 

Source
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: u64

Incremented 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

Source

pub fn place(&self) -> &str

The top place’s id, ROOT at the root.

Source

pub fn depth(&self) -> usize

How many places deep (0 at the root).

Source

pub fn mode_of(&self, group: &str) -> Option<&FrameId>

The mode on in a group.

Source

pub fn is_on(&self, frame: &FrameId) -> bool

Whether a frame is on (a place on the path or an active mode).

Source

pub fn has_pushed(&self) -> bool

Whether a pushed mode is on (what nav.back pops first).

Source

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).

Source

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.

Source

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.

Source

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 Clone for State

Source§

fn clone(&self) -> State

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for State

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for State

Source§

fn default() -> State

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for State

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for State

Source§

fn eq(&self, other: &State) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for State

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,