Skip to main content

ComponentUiStateSnapshot

Struct ComponentUiStateSnapshot 

Source
pub struct ComponentUiStateSnapshot { /* private fields */ }
Expand description

Declarative per-instance UI interaction state captured at revision R for background migration.

Implementations§

Source§

impl ComponentUiStateSnapshot

Accessor and builder helpers for ComponentUiStateSnapshot.

Source

pub fn scroll_anchor(&self) -> Option<&str>

Returns the optional scroll anchor business key.

§Returns
  • Option<&str> - Scroll anchor key if set.
Source

pub fn focused_node(&self) -> Option<&str>

Returns the optional focused logical node key.

§Returns
  • Option<&str> - Focused node key if set.
Source

pub fn with_scroll(self, anchor_key: String, offset_y: f32) -> Self

Sets the scroll anchor business key and pixel offset on this snapshot.

§Arguments
  • String - Business anchor key.
  • f32 - Logical scroll Y offset.
§Returns
  • Self - Updated snapshot.
Source

pub fn with_focus(self, node_key: String) -> Self

Sets the focused logical node key on this snapshot.

§Arguments
  • String - Focused node key.
§Returns
  • Self - Updated snapshot.
Source

pub fn with_draft_field(self, key: String, value: String) -> Self

Inserts a form draft field into this snapshot.

§Arguments
  • String - Draft field name.
  • String - Draft field value.
§Returns
  • Self - Updated snapshot.
Source§

impl ComponentUiStateSnapshot

Source

pub fn get_address(&self) -> &StableAddress

Source

pub fn get_mut_address(&mut self) -> &mut StableAddress

Source

pub fn set_address(&mut self, val: StableAddress) -> &mut Self

Source

pub fn get_schema_version(&self) -> u32

Source

pub fn get_mut_schema_version(&mut self) -> &mut u32

Source

pub fn set_schema_version(&mut self, val: u32) -> &mut Self

Source

pub fn get_mut_scroll_anchor_key(&mut self) -> &mut Option<String>

Source

pub fn set_scroll_anchor_key(&mut self, val: Option<String>) -> &mut Self

Source

pub fn get_scroll_offset_y(&self) -> f32

Source

pub fn get_mut_scroll_offset_y(&mut self) -> &mut f32

Source

pub fn set_scroll_offset_y(&mut self, val: f32) -> &mut Self

Source

pub fn get_mut_focused_node_key(&mut self) -> &mut Option<String>

Source

pub fn set_focused_node_key(&mut self, val: Option<String>) -> &mut Self

Source

pub fn get_form_draft(&self) -> &BTreeMap<String, String>

Source

pub fn get_mut_form_draft(&mut self) -> &mut BTreeMap<String, String>

Source

pub fn set_form_draft(&mut self, val: BTreeMap<String, String>) -> &mut Self

Source

pub fn get_local_data(&self) -> &Value

Source

pub fn get_mut_local_data(&mut self) -> &mut Value

Source

pub fn set_local_data(&mut self, val: Value) -> &mut Self

Source§

impl ComponentUiStateSnapshot

Source

pub fn new(address: StableAddress, schema_version: u32) -> Self

Trait Implementations§

Source§

impl Clone for ComponentUiStateSnapshot

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ComponentUiStateSnapshot

Source§

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

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

impl Default for ComponentUiStateSnapshot

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for ComponentUiStateSnapshot

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 ComponentUiStateSnapshot

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Serialize for ComponentUiStateSnapshot

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 ComponentUiStateSnapshot

Auto Trait Implementations§

§

impl Forget for ComponentUiStateSnapshot

§

impl Freeze for ComponentUiStateSnapshot
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, PhantomData<String>: Freeze, *const LeafNode<String, String> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(String, String)>>: Freeze, PhantomData<Value>: Freeze, *const LeafNode<String, Value> is !null: Freeze, PhantomData<Box<(String, Value)>>: Freeze,

§

impl Move for ComponentUiStateSnapshot

§

impl RefUnwindSafe for ComponentUiStateSnapshot

§

impl Send for ComponentUiStateSnapshot
where RawVecInner: Send, NodeRef<Owned, String, String, LeafOrInternal>: Send, BoxRaw<(String, String)>: Send, NodeRef<Owned, String, Value, LeafOrInternal>: Send, BoxRaw<(String, Value)>: Send,

§

impl Sync for ComponentUiStateSnapshot
where RawVecInner: Sync, NodeRef<Owned, String, String, LeafOrInternal>: Sync, BoxRaw<(String, String)>: Sync, NodeRef<Owned, String, Value, LeafOrInternal>: Sync, BoxRaw<(String, Value)>: Sync,

§

impl Unpin for ComponentUiStateSnapshot
where *const u8 is !null: Unpin, *const LeafNode<String, String> is !null: Unpin, Box<(String, String)>: Unpin, *const LeafNode<String, Value> is !null: Unpin, Box<(String, Value)>: Unpin,

§

impl UnsafeUnpin for ComponentUiStateSnapshot

§

impl UnwindSafe for ComponentUiStateSnapshot

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.