pub struct SubjectPattern { /* private fields */ }Expand description
A parsed registry subject pattern.
Implementations§
Source§impl SubjectPattern
impl SubjectPattern
Sourcepub fn parse(pattern: &str) -> Result<Self, PatternError>
pub fn parse(pattern: &str) -> Result<Self, PatternError>
Parse a registry pattern (flow/red/{quantile}, {device}/{metric...}).
Same lexical rules as zenkey-build’s registry linter, minus the
reserved-leaf checks (this type also parses patterns served by a
foreign fleet, where local reservations do not apply).
Sourcepub fn chunks(&self) -> &[PatternChunk]
pub fn chunks(&self) -> &[PatternChunk]
The pattern’s positions.
Sourcepub fn matches(&self, tail: &[&str]) -> Option<Vec<(&str, String)>>
pub fn matches(&self, tail: &[&str]) -> Option<Vec<(&str, String)>>
Match a concrete subject tail, binding named variables. A rest
variable binds the remaining chunks joined with /.
Sourcepub fn precedence(&self) -> (Vec<u8>, &str)
pub fn precedence(&self) -> (Vec<u8>, &str)
The parse-precedence key: per-position ranks (literal < var < rest), compared lexicographically, ties broken by pattern text — exactly the order the generated parse arms are emitted in.
Sourcepub fn selector_tail(&self) -> String
pub fn selector_tail(&self) -> String
The selector tail for this family: {var} → *, {var...} → **.
Sourcepub fn ke_format_spec(&self) -> Option<String>
pub fn ke_format_spec(&self) -> Option<String>
The zenoh KeFormat spec for this pattern (${var:*} fields), when
the pattern is expressible in that engine: rest variables are not
(KeFormat’s ** matches zero chunks; {var...} requires one or
more), so they return None and the hand matcher stays normative.
Trait Implementations§
Source§impl Clone for SubjectPattern
impl Clone for SubjectPattern
Source§fn clone(&self) -> SubjectPattern
fn clone(&self) -> SubjectPattern
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SubjectPattern
impl Debug for SubjectPattern
Source§impl Display for SubjectPattern
impl Display for SubjectPattern
impl Eq for SubjectPattern
Source§impl PartialEq for SubjectPattern
impl PartialEq for SubjectPattern
impl StructuralPartialEq for SubjectPattern
Auto Trait Implementations§
impl Freeze for SubjectPattern
impl RefUnwindSafe for SubjectPattern
impl Send for SubjectPattern
impl Sync for SubjectPattern
impl Unpin for SubjectPattern
impl UnsafeUnpin for SubjectPattern
impl UnwindSafe for SubjectPattern
Blanket Implementations§
Source§impl<Source> AccessAs for Source
impl<Source> AccessAs for Source
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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