#[non_exhaustive]pub struct Refusal {
pub code: String,
pub message: String,
pub detail: Option<Value>,
}Expand description
The body of an Error frame: a refusal of either operation, or the lagged
or cancelled ending of a subscription.
code is one of codes (an unknown code is kept as received);
message is for people and is not a stable interface. lagged and
cursor_expired carry detail {"through": <cursor>}. Unknown members
are ignored.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.code: String§message: String§detail: Option<Value>Implementations§
Source§impl Refusal
impl Refusal
Sourcepub fn new(code: impl Into<String>, message: impl Into<String>) -> Self
pub fn new(code: impl Into<String>, message: impl Into<String>) -> Self
A refusal without detail.
Sourcepub fn lagged(through: impl Into<Cursor>, message: impl Into<String>) -> Self
pub fn lagged(through: impl Into<Cursor>, message: impl Into<String>) -> Self
The lagged ending: through is the last notified cursor.
Sourcepub fn cancelled(message: impl Into<String>) -> Self
pub fn cancelled(message: impl Into<String>) -> Self
The cancelled ending a provider may send after the caller’s own
Cancel. A reader treats it, after its own Cancel, as the normal end.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Refusal
impl<'de> Deserialize<'de> for Refusal
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Refusal
impl StructuralPartialEq for Refusal
Auto Trait Implementations§
impl Freeze for Refusal
impl RefUnwindSafe for Refusal
impl Send for Refusal
impl Sync for Refusal
impl Unpin for Refusal
impl UnsafeUnpin for Refusal
impl UnwindSafe for Refusal
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
Mutably borrows from an owned value. Read more