pub struct StableAddress { /* private fields */ }Expand description
Stable nested instance identity (route#tab/entity/slot[/child]) immune to arena or render index changes.
Implementations§
Source§impl StableAddress
Construction, formatting, and parsing helpers for StableAddress.
impl StableAddress
Construction, formatting, and parsing helpers for StableAddress.
Sourcepub fn new(
route_instance: String,
ancestor_keys: Vec<String>,
slot_key: String,
child_key: Option<String>,
) -> Self
pub fn new( route_instance: String, ancestor_keys: Vec<String>, slot_key: String, child_key: Option<String>, ) -> Self
Creates a new StableAddress from route instance, ancestor business keys, slot key, and optional child key.
§Arguments
String- Route instance key (e.g."A#tab-1").Vec<String>- Ancestor logical business keys.String- Logical slot identifier.Option<String>- Optional child business ID key.
§Returns
Self- Constructed stable address.
Sourcepub fn child_key_str(&self) -> Option<&str>
pub fn child_key_str(&self) -> Option<&str>
Source§impl StableAddress
impl StableAddress
pub fn get_route_instance(&self) -> &String
pub fn get_mut_route_instance(&mut self) -> &mut String
pub fn set_route_instance(&mut self, val: String) -> &mut Self
pub fn get_ancestor_keys(&self) -> &Vec<String>
pub fn get_mut_ancestor_keys(&mut self) -> &mut Vec<String>
pub fn set_ancestor_keys(&mut self, val: Vec<String>) -> &mut Self
pub fn get_slot_key(&self) -> &String
pub fn get_mut_slot_key(&mut self) -> &mut String
pub fn set_slot_key(&mut self, val: String) -> &mut Self
pub fn get_mut_child_key(&mut self) -> &mut Option<String>
pub fn set_child_key(&mut self, val: Option<String>) -> &mut Self
Trait Implementations§
Source§impl Clone for StableAddress
impl Clone for StableAddress
Source§impl Debug for StableAddress
impl Debug for StableAddress
Source§impl Default for StableAddress
impl Default for StableAddress
Source§impl<'de> Deserialize<'de> for StableAddress
impl<'de> Deserialize<'de> for StableAddress
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 Eq for StableAddress
Source§impl Hash for StableAddress
impl Hash for StableAddress
Source§impl Ord for StableAddress
impl Ord for StableAddress
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for StableAddress
impl PartialEq for StableAddress
Source§impl PartialOrd for StableAddress
impl PartialOrd for StableAddress
Source§impl Serialize for StableAddress
impl Serialize for StableAddress
impl StructuralPartialEq for StableAddress
Auto Trait Implementations§
impl Forget for StableAddress
impl Freeze for StableAddress
impl Move for StableAddress
impl RefUnwindSafe for StableAddress
impl Send for StableAddresswhere
RawVecInner: Send,
impl Sync for StableAddresswhere
RawVecInner: Sync,
impl Unpin for StableAddress
impl UnsafeUnpin for StableAddresswhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
impl UnwindSafe for StableAddresswhere
RawVecInner: UnwindSafe,
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