Skip to main content

Event

Enum Event 

Source
pub enum Event<'a> {
    Atom(Atom<'a>),
    MapStart(ContainerShape),
    MapEnd,
    SeqStart(ContainerShape),
    SeqEnd,
}
Expand description

An event represents an atomic serialization and deserialization event.

§Serialization

Event and Emit are two close relatives. An Emit can be stateful whereas Event represents a single event. Atoms directly create an event whereas the emitters of compound values keep handing out values which again produce events. To go from Emits to events use the SerializeDriver method.

§Deserialization

During deserialization events are passed to a DeserializeDriver to drive the deserialization.

The start events of maps and sequences carry the ContainerShape.

Variants§

§

Atom(Atom<'a>)

§

MapStart(ContainerShape)

§

MapEnd

§

SeqStart(ContainerShape)

§

SeqEnd

Implementations§

Source§

impl<'a> Event<'a>

Source

pub const fn map_start() -> Event<'static>

Creates the start event of a map with the default shape.

Source

pub const fn seq_start() -> Event<'static>

Creates the start event of a sequence with the default shape.

Source

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

Returns an event borrowing from this one.

Source

pub fn to_static(&self) -> Event<'static>

Makes a static clone of the event decoupling the lifetimes.

Trait Implementations§

Source§

impl<'a> Clone for Event<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Event<'_>

Source§

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

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

impl<'a> From<&'a [u8]> for Event<'a>

Source§

fn from(value: &'a [u8]) -> Event<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a str> for Event<'a>

Source§

fn from(value: &'a str) -> Event<'a>

Converts to this type from the input type.
Source§

impl From<()> for Event<'static>

Source§

fn from(_: ()) -> Event<'static>

Converts to this type from the input type.
Source§

impl<'a> From<Atom<'a>> for Event<'a>

Source§

fn from(atom: Atom<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Cow<'a, str>> for Event<'a>

Source§

fn from(value: Cow<'a, str>) -> Event<'a>

Converts to this type from the input type.
Source§

impl From<String> for Event<'static>

Source§

fn from(value: String) -> Event<'static>

Converts to this type from the input type.
Source§

impl<'a> From<Text<'a>> for Event<'a>

Source§

fn from(value: Text<'a>) -> Event<'a>

Converts to this type from the input type.
Source§

impl From<bool> for Event<'static>

Source§

fn from(value: bool) -> Self

Converts to this type from the input type.
Source§

impl From<char> for Event<'static>

Source§

fn from(value: char) -> Self

Converts to this type from the input type.
Source§

impl From<f32> for Event<'static>

Source§

fn from(value: f32) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for Event<'static>

Source§

fn from(value: f64) -> Self

Converts to this type from the input type.
Source§

impl From<i64> for Event<'static>

Source§

fn from(value: i64) -> Self

Converts to this type from the input type.
Source§

impl From<i128> for Event<'static>

Source§

fn from(value: i128) -> Self

Converts to this type from the input type.
Source§

impl From<isize> for Event<'static>

Source§

fn from(value: isize) -> Self

Converts to this type from the input type.
Source§

impl From<u64> for Event<'static>

Source§

fn from(value: u64) -> Self

Converts to this type from the input type.
Source§

impl From<u128> for Event<'static>

Source§

fn from(value: u128) -> Self

Converts to this type from the input type.
Source§

impl From<usize> for Event<'static>

Source§

fn from(value: usize) -> Self

Converts to this type from the input type.
Source§

impl<'a> PartialEq for Event<'a>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<'a> StructuralPartialEq for Event<'a>

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Event<'a>

§

impl<'a> !UnwindSafe for Event<'a>

§

impl<'a> Freeze for Event<'a>

§

impl<'a> Send for Event<'a>

§

impl<'a> Sync for Event<'a>

§

impl<'a> Unpin for Event<'a>

§

impl<'a> UnsafeUnpin for Event<'a>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.