[][src]Trait ruma_events::TryFromRaw

pub trait TryFromRaw: Sized {
    type Raw: DeserializeOwned;
    type Err: Display;
    fn try_from_raw(_: Self::Raw) -> Result<Self, Self::Err>;
}

Types corresponding to some item in the matrix spec. Types that implement this trait have a corresponding 'raw' type, a potentially invalid representation that can be converted to Self.

Associated Types

type Raw: DeserializeOwned

The raw type.

type Err: Display

The error type returned if conversion fails.

Loading content...

Required methods

fn try_from_raw(_: Self::Raw) -> Result<Self, Self::Err>

Tries to convert the raw type to Self.

Loading content...

Implementors

impl TryFromRaw for ruma_events::collections::all::Event[src]

type Raw = Event

type Err = String

impl TryFromRaw for ruma_events::collections::all::RoomEvent[src]

type Raw = RoomEvent

type Err = String

impl TryFromRaw for StateEvent[src]

type Raw = StateEvent

type Err = String

impl TryFromRaw for ruma_events::collections::only::Event[src]

type Raw = Event

type Err = String

impl TryFromRaw for ruma_events::collections::only::RoomEvent[src]

type Raw = RoomEvent

type Err = String

impl TryFromRaw for StartEventContent[src]

type Raw = StartEventContent

type Err = &'static str

impl TryFromRaw for AnyStrippedStateEvent[src]

type Raw = StrippedState

type Err = String

impl TryFromRaw for AnyToDeviceEvent[src]

type Raw = AnyToDeviceEvent

type Err = String

impl TryFromRaw for StartEvent[src]

type Raw = StartEvent

type Err = &'static str

impl TryFromRaw for NameEvent[src]

type Raw = NameEvent

type Err = InvalidInput

impl TryFromRaw for NameEventContent[src]

type Raw = NameEventContent

type Err = InvalidInput

impl<C> TryFromRaw for StrippedStateEvent<C> where
    C: TryFromRaw
[src]

type Raw = StrippedStateEvent<C::Raw>

type Err = C::Err

impl<C> TryFromRaw for ToDeviceEvent<C> where
    C: TryFromRaw
[src]

type Raw = ToDeviceEvent<C::Raw>

type Err = C::Err

impl<T: FromRaw> TryFromRaw for T[src]

type Raw = <T as FromRaw>::Raw

type Err = Infallible

Loading content...