Trait MlsRsTranscode

Source
pub trait MlsRsTranscode: MlsDecode + MlsEncode {
    type Target: Parsable + Serializable;

    // Provided methods
    fn transcode_from_mls_spec(
        item: &Self::Target,
    ) -> Result<Self, MlsSpecError>
       where Self: Sized { ... }
    fn transcode_to_mls_spec(&self) -> Result<Self::Target, MlsSpecError> { ... }
}
Available on crate feature mls-rs-compat only.
Expand description

Trait that allows to move from mls-spec data structs to mls-rs It is inefficient by nature because in order to bypass the Rust type system, we’re using serialization/deserialization as a “boundary break”

Additionally, none of the trait implementations are done here because we don’t want to depend directly on mls_rs. So you’ll have to implement it on your side like such:

impl mls_spec::mls_rs_compat::MlsRsTranscode for mls_rs::MlsMessage {
    type Target = mls_spec::messages::MlsMessage;
}

Required Associated Types§

Provided Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§