zenoh_keyexpr::key_expr::format

Struct OwnedKeFormat

source
pub struct OwnedKeFormat<Storage: IKeFormatStorage<'static> + 'static = Vec<Segment<'static>>> { /* private fields */ }
Expand description

A KeFormat that owns its format-string.

Methods from Deref<Target = KeFormat<'static, Storage>>§

source

pub fn parse(&'s self, target: &'s keyexpr) -> ZResult<Parsed<'s, Storage>>

Parses target according to self. The returned Parsed object can be used to extract the values of the fields in self from target.

Parsing is greedy and done left-to-right. Please refer to KeFormat’s documentation for more details.

§Errors

If target does not intersect with self, an error is returned.

source

pub fn formatter(&'s self) -> KeFormatter<'s, Storage>

Constructs a new formatter for the format.

Trait Implementations§

source§

impl<Storage: IKeFormatStorage<'static> + 'static> Deref for OwnedKeFormat<Storage>

source§

type Target = KeFormat<'static, Storage>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<Storage: IKeFormatStorage<'static> + 'static> FromStr for OwnedKeFormat<Storage>

source§

type Err = <KeFormat<'static, Storage> as TryFrom<&'static str>>::Error

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl<Storage: IKeFormatStorage<'static> + 'static> TryFrom<Box<str>> for OwnedKeFormat<Storage>

source§

type Error = <KeFormat<'static, Storage> as TryFrom<&'static str>>::Error

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

fn try_from(value: Box<str>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<Storage: IKeFormatStorage<'static> + 'static> TryFrom<String> for OwnedKeFormat<Storage>

source§

type Error = <KeFormat<'static, Storage> as TryFrom<&'static str>>::Error

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

fn try_from(value: String) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<Storage> Freeze for OwnedKeFormat<Storage>
where Storage: Freeze,

§

impl<Storage> RefUnwindSafe for OwnedKeFormat<Storage>
where Storage: RefUnwindSafe,

§

impl<Storage> Send for OwnedKeFormat<Storage>
where Storage: Send,

§

impl<Storage> Sync for OwnedKeFormat<Storage>
where Storage: Sync,

§

impl<Storage> Unpin for OwnedKeFormat<Storage>
where Storage: Unpin,

§

impl<Storage> UnwindSafe for OwnedKeFormat<Storage>
where Storage: UnwindSafe,

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> AsNode<T> for T

source§

fn as_node(&self) -> &T

source§

impl<T> AsNodeMut<T> for T

source§

fn as_node_mut(&mut self) -> &mut T

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> 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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.