Struct Subscriptions
pub struct Subscriptions { /* private fields */ }Expand description
What an observer wants to be told: the core catalogue, patterns, or nothing.
A pattern is an exact name (tool.completed, demo.published), a namespace (demo.*) or
everything (*). Subscriptions::core, the default of Plugin::subscriptions,
is every event of the core catalogue and no custom one: an observer written before custom events
existed receives what it always did, and a custom event reaches only an observer that asks.
Implementations§
§impl Subscriptions
impl Subscriptions
pub fn none() -> Subscriptions
pub fn none() -> Subscriptions
Nothing: the observer is never offered an event.
pub fn core() -> Subscriptions
pub fn core() -> Subscriptions
Every core event and no custom one: what an observer received before custom events.
pub fn all() -> Subscriptions
pub fn all() -> Subscriptions
Every event, core and custom (*).
pub fn of<S>(
patterns: impl IntoIterator<Item = S>,
) -> Result<Subscriptions, DeclarationError>
pub fn of<S>( patterns: impl IntoIterator<Item = S>, ) -> Result<Subscriptions, DeclarationError>
Exactly these patterns, and no core event unless one of them matches it.
§Errors
DeclarationError::BadPattern for a pattern that is not an exact name, ns.* or *.
pub fn with(self, pattern: &str) -> Result<Subscriptions, DeclarationError>
pub fn with(self, pattern: &str) -> Result<Subscriptions, DeclarationError>
pub fn check(
&self,
plugin: &str,
declared: &BTreeSet<String>,
) -> Result<(), DeclarationError>
pub fn check( &self, plugin: &str, declared: &BTreeSet<String>, ) -> Result<(), DeclarationError>
Whether every pattern can match something: its namespace is a core one or is in declared
(the namespaces of the events some tool, agent or plugin declares), and an exact core name is
in the catalogue. plugin names the plugin in the error.
§Errors
Trait Implementations§
§impl Clone for Subscriptions
impl Clone for Subscriptions
§fn clone(&self) -> Subscriptions
fn clone(&self) -> Subscriptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for Subscriptions
impl Debug for Subscriptions
§impl Default for Subscriptions
impl Default for Subscriptions
§fn default() -> Subscriptions
fn default() -> Subscriptions
impl Eq for Subscriptions
§impl PartialEq for Subscriptions
impl PartialEq for Subscriptions
impl StructuralPartialEq for Subscriptions
Auto Trait Implementations§
impl Freeze for Subscriptions
impl RefUnwindSafe for Subscriptions
impl Send for Subscriptions
impl Sync for Subscriptions
impl Unpin for Subscriptions
impl UnsafeUnpin for Subscriptions
impl UnwindSafe for Subscriptions
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].