pub struct WireExpr<'a> {
pub scope: ExprId,
pub suffix: Cow<'a, str>,
pub mapping: Mapping,
}
Expand description
A zenoh resource is represented by a pair composed by a key and a
value, such as, (car/telemetry/speed, 320)
. A resource key
is an arbitrary array of characters, with the exclusion of the symbols
*
, **
, ?
, [
, ]
, and #
,
which have special meaning in the context of zenoh.
A key including any number of the wildcard symbols, *
and **
,
such as, /car/telemetry/*
, is called a key expression as it
denotes a set of keys. The wildcard character *
expands to an
arbitrary string not including zenoh’s reserved characters and the /
character, while the **
expands to strings that may also include the
/
character.
Finally, it is worth mentioning that for time and space efficiency matters,
zenoh will automatically map key expressions to small integers. The mapping is automatic,
but it can be triggered excplicily by with zenoh::Session::declare_keyexpr()
.
Fields§
§scope: ExprId
§suffix: Cow<'a, str>
§mapping: Mapping
Implementations§
Source§impl<'a> WireExpr<'a>
impl<'a> WireExpr<'a>
pub fn empty() -> Self
pub fn is_empty(&self) -> bool
pub fn as_str(&'a self) -> &'a str
pub fn try_as_str(&'a self) -> ZResult<&'a str>
pub fn as_id(&'a self) -> ExprId
pub fn try_as_id(&'a self) -> ZResult<ExprId>
pub fn as_id_and_suffix(&'a self) -> (ExprId, &'a str)
pub fn has_suffix(&self) -> bool
pub fn to_owned(&self) -> WireExpr<'static>
pub fn with_suffix(self, suffix: &'a str) -> Self
Trait Implementations§
Source§impl<'a> From<&'a OwnedKeyExpr> for WireExpr<'a>
impl<'a> From<&'a OwnedKeyExpr> for WireExpr<'a>
Source§fn from(val: &'a OwnedKeyExpr) -> Self
fn from(val: &'a OwnedKeyExpr) -> Self
impl<'a> Eq for WireExpr<'a>
impl<'a> StructuralPartialEq for WireExpr<'a>
Auto Trait Implementations§
impl<'a> Freeze for WireExpr<'a>
impl<'a> RefUnwindSafe for WireExpr<'a>
impl<'a> Send for WireExpr<'a>
impl<'a> Sync for WireExpr<'a>
impl<'a> Unpin for WireExpr<'a>
impl<'a> UnwindSafe for WireExpr<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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