[−][src]Struct twilight_model::gateway::event::gateway::GatewayEventDeserializerOwned
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]
op: u8,
sequence: Option<u64>,
event_type: impl Into<Option<String>>
) -> Self
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]
pub fn clone(&self) -> GatewayEventDeserializerOwned
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for GatewayEventDeserializerOwned
[src]
impl<'de> DeserializeSeed<'de> for GatewayEventDeserializerOwned
[src]
type Value = GatewayEvent
The type produced by using this seed.
pub fn deserialize<D: Deserializer<'de>>(
self,
deserializer: D
) -> Result<Self::Value, D::Error>
[src]
self,
deserializer: D
) -> Result<Self::Value, D::Error>
impl Eq for GatewayEventDeserializerOwned
[src]
impl PartialEq<GatewayEventDeserializerOwned> for GatewayEventDeserializerOwned
[src]
pub fn eq(&self, other: &GatewayEventDeserializerOwned) -> bool
[src]
pub fn ne(&self, other: &GatewayEventDeserializerOwned) -> bool
[src]
impl StructuralEq for GatewayEventDeserializerOwned
[src]
impl StructuralPartialEq for GatewayEventDeserializerOwned
[src]
Auto Trait Implementations
impl RefUnwindSafe for GatewayEventDeserializerOwned
[src]
impl Send for GatewayEventDeserializerOwned
[src]
impl Sync for GatewayEventDeserializerOwned
[src]
impl Unpin for GatewayEventDeserializerOwned
[src]
impl UnwindSafe for GatewayEventDeserializerOwned
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,