#[non_exhaustive]pub struct RegistrySlice {
pub version: String,
pub app: String,
pub convention: i64,
pub name: String,
pub service_origin: Option<Declared<ServiceOrigin>>,
pub description: Option<String>,
pub subjects: Vec<SubjectDecl>,
pub procedures: Vec<ProcedureDecl>,
pub blob: Vec<BlobDecl>,
pub media: Vec<MediaDecl>,
pub deprecated: Vec<DeprecationDecl>,
}Expand description
What one build says it serves: the payload of an introspect reply.
#[non_exhaustive]: every version of this type so far has been the
previous one plus a field (encoding v1.5, blob v1.8, media
v1.16), and each of those was a breaking change for anyone
constructing one. It is a parse result, not a thing callers build
— parse_slice is the constructor — so the attribute costs the
intended use nothing and stops the next field being a break (#325).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.version: String[registry] version — the number a version-skew check compares.
app: String§convention: i64The convention major version (1 for keyspace-v2 as ratified).
name: StringThe producer or service base name (sysinfo, catalog, …).
service_origin: Option<Declared<ServiceOrigin>>Some(origin) for a service (@catalog); None for a host producer,
whose origin is the host it runs on and therefore not in the slice.
description: Option<String>§subjects: Vec<SubjectDecl>§procedures: Vec<ProcedureDecl>§blob: Vec<BlobDecl>The @blob tiers this build serves (RFC 08 §2/§6, v1.8). Empty for
every producer that serves no blobs, and for any slice written before
v1.8 — the parser is forward- and backward-tolerant here, which is
the same posture it takes to unknown keys.
media: Vec<MediaDecl>The @media streams this build publishes (RFC 08 §2/§6, v1.16 —
closing the asymmetry v1.8 recorded). Same tolerance as blob:
empty for non-media producers and for every slice written earlier.
deprecated: Vec<DeprecationDecl>Implementations§
Source§impl RegistrySlice
impl RegistrySlice
Sourcepub fn new(
version: impl Into<String>,
app: impl Into<String>,
name: impl Into<String>,
) -> Self
pub fn new( version: impl Into<String>, app: impl Into<String>, name: impl Into<String>, ) -> Self
An empty slice with its required header. convention is the
keyspace-v2 major version, 1; the collections start empty and are
assignable.
parse_slice is how a slice normally arrives — this is for the
callers that build one to compare against.
Sourcepub fn subjects_in(
&self,
class: impl Into<Declared<Class>>,
) -> impl Iterator<Item = &SubjectDecl>
pub fn subjects_in( &self, class: impl Into<Declared<Class>>, ) -> impl Iterator<Item = &SubjectDecl>
Subjects of one class.
Takes the vocabulary, not a &str: subjects_in("telementry") used
to compile and answer “no subjects”, which is the same answer an
honestly empty class gives. Class::State is the ordinary spelling;
a Declared answers the same question about a class token only a
newer fleet member knows.
Sourcepub fn serves_subject(&self, path: &str) -> bool
pub fn serves_subject(&self, path: &str) -> bool
Does this slice serve a subject with exactly this pattern?
Sourcepub fn serves_procedure(&self, path: &str) -> bool
pub fn serves_procedure(&self, path: &str) -> bool
Does this slice serve this procedure?
Sourcepub fn blob_tiers(&self) -> impl Iterator<Item = &Declared<BlobTier>>
pub fn blob_tiers(&self) -> impl Iterator<Item = &Declared<BlobTier>>
Every @blob tier this slice declares, recognised or not.
The Other tokens are the interesting ones: RFC 08 §6 makes a tier
this build cannot name a finding about version skew, which is only
possible because parse_slice carries it rather than dropping it.
Sourcepub fn serves_media(&self, path: &str) -> bool
pub fn serves_media(&self, path: &str) -> bool
Does this slice publish a @media stream with exactly this pattern
(RFC 07 §1, in the slice since v1.16)?
Trait Implementations§
Source§impl Clone for RegistrySlice
impl Clone for RegistrySlice
Source§fn clone(&self) -> RegistrySlice
fn clone(&self) -> RegistrySlice
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 RegistrySlice
impl Debug for RegistrySlice
impl Eq for RegistrySlice
Source§impl PartialEq for RegistrySlice
impl PartialEq for RegistrySlice
impl StructuralPartialEq for RegistrySlice
Auto Trait Implementations§
impl Freeze for RegistrySlice
impl RefUnwindSafe for RegistrySlice
impl Send for RegistrySlice
impl Sync for RegistrySlice
impl Unpin for RegistrySlice
impl UnsafeUnpin for RegistrySlice
impl UnwindSafe for RegistrySlice
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§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