Class KeyExpression
The naming rules a Zenoh network addresses data by.
public static class KeyExpression
- Inheritance
-
KeyExpression
- Inherited Members
Remarks
A key expression is a slash-separated path that may carry the * and
** wildcards, so one subscriber names a whole subtree of a fleet rather
than each node in it. Only the naming rules cross: running a Zenoh session
needs the std-only zenoh stack, which stays in the Rust crate.
Methods
Canonize(string)
Rewrites a key expression into its canonical form.
public static string? Canonize(string key)
Parameters
keystringThe expression to canonize.
Returns
- string
The canonical form, or
nullif the expression is malformed.
Remarks
Two expressions that select the same data have one canonical form, so canonizing before comparing or routing keeps equivalent expressions equal.
IsCanon(string)
Reports whether a key expression is already canonical.
public static bool IsCanon(string key)
Parameters
keystringThe expression to check.
Returns
- bool
truewhen the expression is canonical.
IsValid(string)
Reports whether a key expression is well formed.
public static bool IsValid(string key)
Parameters
keystringThe expression to check.
Returns
- bool
truewhen the expression is valid.
Matches(string, string)
Reports whether a pattern selects a key.
public static bool Matches(string pattern, string key)
Parameters
patternstringThe expression that may carry wildcards.
keystringThe concrete key to test against it.
Returns
- bool
truewhen the pattern selects the key.