pub enum EventResult {
Continue,
Stop,
Modified(Vec<u8>),
}Expand description
Result returned by event handlers
Determines how the event dispatch should proceed after a handler executes.
Variants§
Continue
Continue processing with the next handler
This is the default behavior - the event will be passed to the next handler in the priority chain.
Stop
Stop processing and don’t call remaining handlers
Use this when an event has been fully handled and no further processing is needed. Subsequent handlers will not be called.
Modified(Vec<u8>)
Modify the event data and continue
Used primarily for legacy hook compatibility where handlers can transform data (e.g., filtering output, modifying input). The modified data will be passed to subsequent handlers.
Implementations§
Source§impl EventResult
impl EventResult
Sourcepub fn is_continue(&self) -> bool
pub fn is_continue(&self) -> bool
Check if this result indicates continuation
Sourcepub fn is_modified(&self) -> bool
pub fn is_modified(&self) -> bool
Check if this result contains modified data
Sourcepub fn into_modified(self) -> Option<Vec<u8>>
pub fn into_modified(self) -> Option<Vec<u8>>
Extract modified data if present
Sourcepub fn as_modified(&self) -> Option<&[u8]>
pub fn as_modified(&self) -> Option<&[u8]>
Get a reference to modified data if present
Trait Implementations§
Source§impl Clone for EventResult
impl Clone for EventResult
Source§fn clone(&self) -> EventResult
fn clone(&self) -> EventResult
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EventResult
impl Debug for EventResult
Source§impl PartialEq for EventResult
impl PartialEq for EventResult
impl Eq for EventResult
impl StructuralPartialEq for EventResult
Auto Trait Implementations§
impl Freeze for EventResult
impl RefUnwindSafe for EventResult
impl Send for EventResult
impl Sync for EventResult
impl Unpin for EventResult
impl UnsafeUnpin for EventResult
impl UnwindSafe for EventResult
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.