pub struct EmittedEvent {
pub event: String,
pub ack: Option<Value>,
}Expand description
What an emitted event produced.
Fields§
§event: String§ack: Option<Value>What went back through the ack, if anything. None means the
handler answered nothing — a connection-style handler.
Implementations§
Source§impl EmittedEvent
impl EmittedEvent
Sourcepub fn value(&self) -> Value
pub fn value(&self) -> Value
The acked value.
§Panics
If nothing was acked, naming the event — the usual cause is a handler that needs a live socket.
Sourcepub fn error_code(&self) -> Option<&str>
pub fn error_code(&self) -> Option<&str>
The error.code when the handler (or validation) refused.
pub fn error_message(&self) -> Option<&str>
pub fn is_error(&self) -> bool
Sourcepub fn needs_socket(&self) -> bool
pub fn needs_socket(&self) -> bool
True when the handler declined because it wants a real socket.
Sourcepub fn json<T: DeserializeOwned>(&self) -> T
pub fn json<T: DeserializeOwned>(&self) -> T
The acked value as T.
Auto Trait Implementations§
impl Freeze for EmittedEvent
impl RefUnwindSafe for EmittedEvent
impl Send for EmittedEvent
impl Sync for EmittedEvent
impl Unpin for EmittedEvent
impl UnsafeUnpin for EmittedEvent
impl UnwindSafe for EmittedEvent
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