[][src]Struct twilight_model::gateway::event::gateway::GatewayEventDeserializerOwned

pub struct GatewayEventDeserializerOwned { /* fields omitted */ }

A deserializer that deserializes into a GatewayEvent by cloning some bits of scanned information before the actual deserialisation.

This is the owned version of GatewayEventDeserializer.

You should use this if you're using a mutable deserialization library like simd-json.

Implementations

impl GatewayEventDeserializerOwned[src]

pub fn new(
    op: u8,
    sequence: Option<u64>,
    event_type: impl Into<Option<String>>
) -> Self
[src]

Create a new owned gateway event deserializer when you already know the event type and opcode.

This might be useful if you scan the payload for this information and do some work with the event type prior to deserializing the payload.

pub fn from_json(input: &str) -> Option<Self>[src]

pub fn event_type_ref(&self) -> Option<&str>[src]

Return an immutable reference to the event type of the payload.

pub fn op(&self) -> u8[src]

Return the opcode of the payload.

pub fn sequence(&self) -> Option<u64>[src]

Return the sequence of the payload.

pub fn into_parts(self) -> (u8, Option<u64>, Option<String>)[src]

Consume the deserializer, returning its opcode, sequence, and event type components.

Trait Implementations

impl Clone for GatewayEventDeserializerOwned[src]

impl Debug for GatewayEventDeserializerOwned[src]

impl<'de> DeserializeSeed<'de> for GatewayEventDeserializerOwned[src]

type Value = GatewayEvent

The type produced by using this seed.

impl Eq for GatewayEventDeserializerOwned[src]

impl PartialEq<GatewayEventDeserializerOwned> for GatewayEventDeserializerOwned[src]

impl StructuralEq for GatewayEventDeserializerOwned[src]

impl StructuralPartialEq for GatewayEventDeserializerOwned[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.