Struct zenoh::Path[][src]

pub struct Path { /* fields omitted */ }

A zenoh Path is a set of strings separated by '/' , as in a filesystem path.

A Path cannot contain any '*' character. Examples of paths: "/demo/example/hello" , "/org/eclipse/building/be/floor/1/office/2"

A path can be absolute (i.e. starting with a '/') or relative to a Workspace.

Implementations

impl Path[src]

pub fn new(p: &str) -> ZResult<Path>[src]

Creates a new Path from a String, checking its validity.
Returns Err(ZError) if not valid.

pub fn as_str(&self) -> &str[src]

Returns the Path as a &str.

pub fn is_relative(&self) -> bool[src]

Returns true is this Path is relative (i.e. not starting with '/').

pub fn last_segment(&self) -> &str[src]

Returns the last segment of this Path.
I.e.: the part after the last ‘/’, or the complete Path if there is no ‘/’.

pub fn with_prefix(&self, prefix: &Path) -> Self[src]

Returns the concatenation of prefix with this Path.

pub fn strip_prefix(&self, prefix: &Path) -> Option<Self>[src]

If this Path starts with prefix returns a copy of this Path with the prefix removed.
Otherwise, returns None.

Trait Implementations

impl Clone for Path[src]

impl Debug for Path[src]

impl Display for Path[src]

impl Eq for Path[src]

impl From<&'_ Path> for ResKey[src]

impl From<&'_ Path> for PathExpr[src]

impl From<Path> for ResKey[src]

impl From<Path> for PathExpr[src]

impl Hash for Path[src]

impl PartialEq<Path> for Path[src]

impl StructuralEq for Path[src]

impl StructuralPartialEq for Path[src]

impl TryFrom<&'_ str> for Path[src]

type Error = ZError

The type returned in the event of a conversion error.

impl TryFrom<String> for Path[src]

type Error = ZError

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Path

impl Send for Path

impl Sync for Path

impl Unpin for Path

impl UnwindSafe for Path

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,