Table of Contents

Class KeyExpression

Namespace
Pamoja.Zenoh
Assembly
Pamoja.Zenoh.dll

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

key string

The expression to canonize.

Returns

string

The canonical form, or null if 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

key string

The expression to check.

Returns

bool

true when the expression is canonical.

IsValid(string)

Reports whether a key expression is well formed.

public static bool IsValid(string key)

Parameters

key string

The expression to check.

Returns

bool

true when the expression is valid.

Matches(string, string)

Reports whether a pattern selects a key.

public static bool Matches(string pattern, string key)

Parameters

pattern string

The expression that may carry wildcards.

key string

The concrete key to test against it.

Returns

bool

true when the pattern selects the key.