pub struct ActorPath(/* private fields */);Expand description
A slash-separated path that uniquely identifies an actor in the system (e.g. /user/orders/order-42).
Paths are built by appending segments with the / operator. The first
segment is conventionally the root scope (user, system, etc.).
Implementations§
Source§impl ActorPath
impl ActorPath
Sourcepub fn parent(&self) -> Self
pub fn parent(&self) -> Self
Returns this path with its last segment removed, or an empty path if already at root.
Sourcepub fn at_level(&self, level: usize) -> Self
pub fn at_level(&self, level: usize) -> Self
Returns this path truncated to level segments, or self unchanged if level is out of range.
Sourcepub const fn is_empty(&self) -> bool
pub const fn is_empty(&self) -> bool
Returns true if this path has no segments (e.g. parsed from "/").
Sourcepub fn is_ancestor_of(&self, other: &Self) -> bool
pub fn is_ancestor_of(&self, other: &Self) -> bool
Returns true if this path is a proper prefix of other, meaning this actor is an ancestor of other.
Sourcepub fn is_descendant_of(&self, other: &Self) -> bool
pub fn is_descendant_of(&self, other: &Self) -> bool
Returns true if other is a proper prefix of this path, meaning this actor is a descendant of other.
Sourcepub fn is_parent_of(&self, other: &Self) -> bool
pub fn is_parent_of(&self, other: &Self) -> bool
Returns true if this path is the direct parent of other (one level above it).
Sourcepub fn is_child_of(&self, other: &Self) -> bool
pub fn is_child_of(&self, other: &Self) -> bool
Returns true if other is the direct parent of this path (this path is one level below other).
Sourcepub const fn is_top_level(&self) -> bool
pub const fn is_top_level(&self) -> bool
Returns true if this path has exactly one segment, i.e. it is a direct child of the root scope.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ActorPath
impl<'de> Deserialize<'de> for ActorPath
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>,
Source§impl Div<&str> for ActorPath
Appends segment as a new path component: parent_path / "child-id".
impl Div<&str> for ActorPath
Appends segment as a new path component: parent_path / "child-id".
Source§impl From<&str> for ActorPath
Creates a path from a /-separated string such as "/user/parent/child".
impl From<&str> for ActorPath
Creates a path from a /-separated string such as "/user/parent/child".
Source§impl From<String> for ActorPath
Creates a path from a string. Equivalent to ActorPath::from with a &str.
impl From<String> for ActorPath
Creates a path from a string. Equivalent to ActorPath::from with a &str.