pub struct StatePath { /* private fields */ }Expand description
A path into a state tree.
Implementations§
Source§impl StatePath
impl StatePath
Sourcepub fn parse(s: &str) -> Result<Self, PathError>
pub fn parse(s: &str) -> Result<Self, PathError>
Parse a path from a string like “/nodes/0/hostname”.
Sourcepub fn components(&self) -> &[PathComponent]
pub fn components(&self) -> &[PathComponent]
Return the path components.
Sourcepub fn last(&self) -> Option<&PathComponent>
pub fn last(&self) -> Option<&PathComponent>
Return the last component (or None if this is root).
Sourcepub fn push_index(&self, index: usize) -> Self
pub fn push_index(&self, index: usize) -> Self
Append an index component.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for StatePath
impl<'de> Deserialize<'de> for StatePath
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 StatePath
impl StructuralPartialEq for StatePath
Auto Trait Implementations§
impl Freeze for StatePath
impl RefUnwindSafe for StatePath
impl Send for StatePath
impl Sync for StatePath
impl Unpin for StatePath
impl UnsafeUnpin for StatePath
impl UnwindSafe for StatePath
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