Struct zenoh::Selector [−][src]
A zenoh Selector is the conjunction of a path expression identifying a set of paths and some optional parts allowing to refine the set of paths and associated values.
Structure of a selector:
/s1/s2/.../sn?x>1&y<2&...&z=4(p1=v1;p2=v2;...;pn=vn)[a;b;x;y;...;z]
| | | | | | | |
|-- expr ---| |--- filter --| |---- properties ---| |--fragment-|
where:
- expr: is a
PathExpr
. - filter: a list of predicates separated by
'&'
allowing to perform filtering on the values associated with the matching keys. Each predicate has the form “field
-operator
-value
” value where:- field is the name of a field in the value (is applicable and is existing. otherwise the predicate is false)
- operator is one of a comparison operators:
<
,>
,<=
,>=
,=
,!=
- value is the the value to compare the field’s value with
- fragment: a list of fields names allowing to return a sub-part of each value. This feature only applies to structured values using a “self-describing” encoding, such as JSON or XML. It allows to select only some fields within the structure. A new structure with only the selected fields will be used in place of the original value.
NOTE: the filters and fragments are not yet supported in current zenoh version.
Fields
path_expr: PathExpr
the path expression part of this Selector (before ?
character).
predicate: String
the predicate part of this Selector, as used in zenoh-net.
I.e. all characters starting from ?
.
filter: Option<String>
the filter part of this Selector, if any (all characters after ?
and before (
or [
)
properties: Properties
the properties part of this Selector (all characters between ( )
and after ?
)
fragment: Option<String>
the fragment part of this Selector, if any (all characters between [ ]
and after ?
)
Implementations
impl Selector
[src]
pub fn with_prefix(&self, prefix: &Path) -> Selector
[src]
Returns the concatenation of prefix
with this Selector.
pub fn strip_prefix(&self, prefix: &Path) -> Option<Self>
[src]
If this Selector starts with prefix
returns a copy of this Selector with the prefix removed.
Otherwise, returns None
.
pub fn is_relative(&self) -> bool
[src]
Returns true is this Selector is relative (i.e. not starting with '/'
).
pub fn matches(&self, path: &Path) -> bool
[src]
Returns true if path
matches this Selector’s path expression.
pub fn has_time_range(&self) -> bool
[src]
Returns true if the Selector specifies a time-range in its properties
(i.e. using "starttime"
or "stoptime"
)
Trait Implementations
impl Clone for Selector
[src]
impl Debug for Selector
[src]
impl Display for Selector
[src]
impl PartialEq<Selector> for Selector
[src]
impl StructuralPartialEq for Selector
[src]
impl TryFrom<&'_ Query> for Selector
[src]
type Error = ZError
The type returned in the event of a conversion error.
fn try_from(q: &Query) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ str> for Selector
[src]
type Error = ZError
The type returned in the event of a conversion error.
fn try_from(s: &str) -> ZResult<Selector>
[src]
impl TryFrom<String> for Selector
[src]
Auto Trait Implementations
impl RefUnwindSafe for Selector
impl Send for Selector
impl Sync for Selector
impl Unpin for Selector
impl UnwindSafe for Selector
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,