pub enum Event {
Message(EventMessage),
Notice(EventNotice),
Request(EventRequest),
MetaEvent(EventMetaEvent),
}Variants§
Implementations§
Source§impl Event
impl Event
Sourcepub const fn is_message(&self) -> bool
pub const fn is_message(&self) -> bool
Returns true if the enum is Event::Message otherwise false
Sourcepub const fn is_notice(&self) -> bool
pub const fn is_notice(&self) -> bool
Returns true if the enum is Event::Notice otherwise false
Sourcepub const fn is_request(&self) -> bool
pub const fn is_request(&self) -> bool
Returns true if the enum is Event::Request otherwise false
Sourcepub const fn is_meta_event(&self) -> bool
pub const fn is_meta_event(&self) -> bool
Returns true if the enum is Event::MetaEvent otherwise false
Source§impl Event
impl Event
pub fn selector(&self) -> Selector<'_, Event>
pub fn match_message(&self) -> Option<&EventMessage>
pub fn on_message<T>( &self, handler: impl FnOnce(&EventMessage) -> T, ) -> Option<T>
pub async fn on_message_async<T>( &self, handler: impl AsyncFnOnce(&EventMessage) -> T, ) -> Option<T>
pub fn match_notice(&self) -> Option<&EventNotice>
pub fn on_notice<T>(&self, handler: impl FnOnce(&EventNotice) -> T) -> Option<T>
pub async fn on_notice_async<T>( &self, handler: impl AsyncFnOnce(&EventNotice) -> T, ) -> Option<T>
pub fn match_request(&self) -> Option<&EventRequest>
pub fn on_request<T>( &self, handler: impl FnOnce(&EventRequest) -> T, ) -> Option<T>
pub async fn on_request_async<T>( &self, handler: impl AsyncFnOnce(&EventRequest) -> T, ) -> Option<T>
pub fn match_meta_event(&self) -> Option<&EventMetaEvent>
pub fn on_meta_event<T>( &self, handler: impl FnOnce(&EventMetaEvent) -> T, ) -> Option<T>
pub async fn on_meta_event_async<T>( &self, handler: impl AsyncFnOnce(&EventMetaEvent) -> T, ) -> Option<T>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Event
impl<'de> Deserialize<'de> for Event
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 EventTrait for Event
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnsafeUnpin for Event
impl UnwindSafe for Event
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.