Trait Payload

Source
pub trait Payload: Sized {
    // Required methods
    fn name() -> &'static str;
    fn parse(data: BinaryData) -> Result<Self, ()>;
    fn to_val(self) -> BinaryData;
}
Expand description

Any type that can be sent directly over network tables

Required Methods§

Source

fn name() -> &'static str

Source

fn parse(data: BinaryData) -> Result<Self, ()>

Source

fn to_val(self) -> BinaryData

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 bool

Source§

fn name() -> &'static str

Source§

fn parse(data: BinaryData) -> Result<Self, ()>

Source§

fn to_val(self) -> BinaryData

Source§

impl Payload for f32

Source§

fn name() -> &'static str

Source§

fn parse(data: BinaryData) -> Result<Self, ()>

Source§

fn to_val(self) -> BinaryData

Source§

impl Payload for f64

Source§

fn name() -> &'static str

Source§

fn parse(data: BinaryData) -> Result<Self, ()>

Source§

fn to_val(self) -> BinaryData

Source§

impl Payload for i8

Source§

fn name() -> &'static str

Source§

fn parse(data: BinaryData) -> Result<Self, ()>

Source§

fn to_val(self) -> BinaryData

Source§

impl Payload for i16

Source§

fn name() -> &'static str

Source§

fn parse(data: BinaryData) -> Result<Self, ()>

Source§

fn to_val(self) -> BinaryData

Source§

impl Payload for i32

Source§

fn name() -> &'static str

Source§

fn parse(data: BinaryData) -> Result<Self, ()>

Source§

fn to_val(self) -> BinaryData

Source§

impl Payload for i64

Source§

fn name() -> &'static str

Source§

fn parse(data: BinaryData) -> Result<Self, ()>

Source§

fn to_val(self) -> BinaryData

Source§

impl Payload for i128

Source§

fn name() -> &'static str

Source§

fn parse(data: BinaryData) -> Result<Self, ()>

Source§

fn to_val(self) -> BinaryData

Source§

impl Payload for u8

Source§

fn name() -> &'static str

Source§

fn parse(data: BinaryData) -> Result<Self, ()>

Source§

fn to_val(self) -> BinaryData

Source§

impl Payload for u16

Source§

fn name() -> &'static str

Source§

fn parse(data: BinaryData) -> Result<Self, ()>

Source§

fn to_val(self) -> BinaryData

Source§

impl Payload for u32

Source§

fn name() -> &'static str

Source§

fn parse(data: BinaryData) -> Result<Self, ()>

Source§

fn to_val(self) -> BinaryData

Source§

impl Payload for u64

Source§

fn name() -> &'static str

Source§

fn parse(data: BinaryData) -> Result<Self, ()>

Source§

fn to_val(self) -> BinaryData

Source§

impl Payload for u128

Source§

fn name() -> &'static str

Source§

fn parse(data: BinaryData) -> Result<Self, ()>

Source§

fn to_val(self) -> BinaryData

Source§

impl Payload for String

Source§

fn name() -> &'static str

Source§

fn parse(data: BinaryData) -> Result<Self, ()>

Source§

fn to_val(self) -> BinaryData

Source§

impl Payload for Vec<bool>

Source§

fn name() -> &'static str

Source§

fn parse(data: BinaryData) -> Result<Self, ()>

Source§

fn to_val(self) -> BinaryData

Source§

impl Payload for Vec<f32>

Source§

fn name() -> &'static str

Source§

fn parse(data: BinaryData) -> Result<Self, ()>

Source§

fn to_val(self) -> BinaryData

Source§

impl Payload for Vec<f64>

Source§

fn name() -> &'static str

Source§

fn parse(data: BinaryData) -> Result<Self, ()>

Source§

fn to_val(self) -> BinaryData

Source§

impl Payload for Vec<i64>

Source§

fn name() -> &'static str

Source§

fn parse(data: BinaryData) -> Result<Self, ()>

Source§

fn to_val(self) -> BinaryData

Source§

impl Payload for Vec<u8>

Source§

fn name() -> &'static str

Source§

fn parse(data: BinaryData) -> Result<Self, ()>

Source§

fn to_val(self) -> BinaryData

Source§

impl Payload for Vec<String>

Source§

fn name() -> &'static str

Source§

fn parse(data: BinaryData) -> Result<Self, ()>

Source§

fn to_val(self) -> BinaryData

Implementors§