Skip to main content

LayerEvent

Struct LayerEvent 

Source
pub struct LayerEvent<'e, 'de>(/* private fields */);
Expand description

An event that passes through the Layers.

Events emitted with emit_borrowed borrow from the data that is deserialized for 'de, other events are only valid for 'e. Layers that pass on the event they received retain this.

Implementations§

Source§

impl<'e, 'de> LayerEvent<'e, 'de>

Source

pub fn new(event: Event<'e>) -> LayerEvent<'e, 'de>

Creates an event that is only valid for 'e.

Source

pub fn borrowed(event: Event<'de>) -> LayerEvent<'e, 'de>

Creates an event that borrows from the data being deserialized.

Source

pub fn event(&self) -> &Event<'_>

Returns the event.

Source

pub fn is_borrowed(&self) -> bool

Returns true if the event borrows from the data being deserialized.

Auto Trait Implementations§

§

impl<'e, 'de> !RefUnwindSafe for LayerEvent<'e, 'de>

§

impl<'e, 'de> !UnwindSafe for LayerEvent<'e, 'de>

§

impl<'e, 'de> Freeze for LayerEvent<'e, 'de>

§

impl<'e, 'de> Send for LayerEvent<'e, 'de>

§

impl<'e, 'de> Sync for LayerEvent<'e, 'de>

§

impl<'e, 'de> Unpin for LayerEvent<'e, 'de>

§

impl<'e, 'de> UnsafeUnpin for LayerEvent<'e, 'de>

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.