#[non_exhaustive]pub enum Refusal<Src> {
PayloadOver {
name: String,
limit: usize,
},
Publish {
name: String,
},
Subscription {
source: Src,
},
Conflicting {
open: Src,
refused: Src,
},
}Expand description
One thing the real server refuses, which refuses_like_the_server checks the in-process
transport refuses too.
Src is the broker’s subscription descriptor; a list with no subscription probe names it with
a turbofish (Refusal::<MySource>::Publish { .. }).
§Examples
use ruststream::conformance::in_process::{self, Refusal};
use ruststream::memory::{MemoryBroker, MemorySource};
// What the server refuses, and so what the in-process transport must refuse too.
in_process::refuses_like_the_server(
MemoryBroker::new,
|connected| connected.publisher(),
[
Refusal::Subscription {
source: MemorySource::new("orders.*"),
},
Refusal::PayloadOver {
name: "orders".to_owned(),
limit: 1024 * 1024,
},
],
)
.await;Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
PayloadOver
A publish to name of exactly limit payload bytes is accepted and delivered, one byte
more is refused. The check opens a subscription to name by name before it publishes.
Fields
Publish
A publish to name is refused: a name the server’s grammar rejects, or a destination it
does not have.
Subscription
Opening source is refused: an invalid name, a declaration the server rejects.
Fields
source: SrcThe refused subscription.
Conflicting
With open subscribed, opening refused is refused: a redeclaration that conflicts with
the first one, a second consumer where the server admits one.
Trait Implementations§
Auto Trait Implementations§
impl<Src> Freeze for Refusal<Src>where
Src: Freeze,
impl<Src> RefUnwindSafe for Refusal<Src>where
Src: RefUnwindSafe,
impl<Src> Send for Refusal<Src>where
Src: Send,
impl<Src> Sync for Refusal<Src>where
Src: Sync,
impl<Src> Unpin for Refusal<Src>where
Src: Unpin,
impl<Src> UnsafeUnpin for Refusal<Src>where
Src: UnsafeUnpin,
impl<Src> UnwindSafe for Refusal<Src>where
Src: UnwindSafe,
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
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<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request