Trait Payload

Source
pub trait Payload: ToOwned {
    type TypeInfo;

    // Required methods
    fn payload_type(payload_type: &Self::TypeInfo) -> Result<Option<ObjectType>>;
    fn get(props: &MsgProps<Self>) -> Result<Self::Owned>;
    fn set(&self, props: &mut MsgProps<Self>) -> Result<()>;
}
Available on crate feature aq_unstable only.
Expand description

A trait for payload type

Warning: The type is unstable. It may be changed incompatibly by minor version upgrades.

Required Associated Types§

Required Methods§

Source

fn payload_type(payload_type: &Self::TypeInfo) -> Result<Option<ObjectType>>

Source

fn get(props: &MsgProps<Self>) -> Result<Self::Owned>

Source

fn set(&self, props: &mut MsgProps<Self>) -> Result<()>

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.

Implementations on Foreign Types§

Source§

impl Payload for [u8]

Source§

type TypeInfo = ()

Source§

fn payload_type(_payload_type: &Self::TypeInfo) -> Result<Option<ObjectType>>

Source§

fn get(props: &MsgProps<Self>) -> Result<Vec<u8>>

Source§

fn set(&self, props: &mut MsgProps<Self>) -> Result<()>

Implementors§