[][src]Enum ruma_events::EventResult

pub enum EventResult<T: TryFromRaw> {
    Ok(T),
    Err(InvalidEvent),
}

The result of deserializing an event, which may or may not be valid.

When data is successfully deserialized and validated, this structure will contain the deserialized value T. When deserialization succeeds, but the event is invalid for any reason, this structure will contain an InvalidEvent. See the documentation for InvalidEvent for more details.

Variants

Ok(T)

T deserialized and validated successfully.

T failed either deserialization or validation.

InvalidEvent contains the error message and the raw data.

Methods

impl<T: TryFromRaw> EventResult<T>[src]

pub fn into_result(self) -> Result<T, InvalidEvent>[src]

Convert EventResult<T> into the equivalent std::result::Result<T, InvalidEvent>.

Trait Implementations

impl<T: Clone + TryFromRaw> Clone for EventResult<T>[src]

impl<T: Debug + TryFromRaw> Debug for EventResult<T>[src]

impl<'de, T> Deserialize<'de> for EventResult<T> where
    T: TryFromRaw
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for EventResult<T> where
    T: RefUnwindSafe

impl<T> Send for EventResult<T> where
    T: Send

impl<T> Sync for EventResult<T> where
    T: Sync

impl<T> Unpin for EventResult<T> where
    T: Unpin

impl<T> UnwindSafe for EventResult<T> where
    T: UnwindSafe

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> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> 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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,