Enum AnyPluginEvent

Source
pub enum AnyPluginEvent<'a, P, A>
where for<'b> P: EventSource + ToBytes + FromBytes<'b> + Debug, A: EventSource + ToBytes + FromBytes<'a> + Debug,
{ Plugin(PluginEvent<P>), Async(AsyncEvent<'a, A>), }
Expand description

A generic enum for custom plugin/async event payloads

Type parameters:

  • P specifies the payload of the Plugin variant
  • A specifies the payload of the Async variant

Variants§

§

Plugin(PluginEvent<P>)

§

Async(AsyncEvent<'a, A>)

Trait Implementations§

Source§

impl<'a, P, A> AnyEventPayload for AnyPluginEvent<'a, P, A>
where for<'b> P: EventSource + ToBytes + FromBytes<'b> + Debug, A: EventSource + ToBytes + FromBytes<'a> + Debug,

Source§

const SOURCES: &'static [Option<&'static str>]

The sources of the events that this payload type can represent.
Source§

const EVENT_TYPES: &'static [u16]

The event types that this payload type can represent.
§

fn event_sources() -> Vec<&'static str>

Get all the event sources for this payload type Read more
Source§

impl<'a, P, A> Debug for AnyPluginEvent<'a, P, A>
where for<'b> P: EventSource + ToBytes + FromBytes<'b> + Debug, A: EventSource + ToBytes + FromBytes<'a> + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'raw_event, 'a, P, A> FromRawEvent<'raw_event> for AnyPluginEvent<'a, P, A>
where for<'b> P: EventSource + ToBytes + FromBytes<'b> + Debug, A: EventSource + ToBytes + FromBytes<'a> + Debug, 'raw_event: 'a,

Source§

fn parse(raw: &RawEvent<'raw_event>) -> Result<Self, PayloadFromBytesError>

Parse a raw event into the type implementing this trait
Source§

impl<'a, P, A> PayloadToBytes for AnyPluginEvent<'a, P, A>
where for<'b> P: EventSource + ToBytes + FromBytes<'b> + Debug, A: EventSource + ToBytes + FromBytes<'a> + Debug,

Source§

fn binary_size(&self) -> usize

Get the binary size of the payload Read more
Source§

fn write<W: Write>(&self, metadata: &EventMetadata, writer: W) -> Result<()>

Write the payload to a writer implementing [std::io::Write].

Auto Trait Implementations§

§

impl<'a, P, A> Freeze for AnyPluginEvent<'a, P, A>
where P: Freeze, A: Freeze,

§

impl<'a, P, A> RefUnwindSafe for AnyPluginEvent<'a, P, A>

§

impl<'a, P, A> Send for AnyPluginEvent<'a, P, A>
where P: Send, A: Send,

§

impl<'a, P, A> Sync for AnyPluginEvent<'a, P, A>
where P: Sync, A: Sync,

§

impl<'a, P, A> Unpin for AnyPluginEvent<'a, P, A>
where P: Unpin, A: Unpin,

§

impl<'a, P, A> UnwindSafe for AnyPluginEvent<'a, P, A>
where P: UnwindSafe, A: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.