Skip to main content

FromProtocolValue

Trait FromProtocolValue 

Source
pub trait FromProtocolValue {
    // Required methods
    fn from_text(raw: &[u8]) -> Result<Self, ProtocolError>
       where Self: Sized;
    fn from_binary(raw: &[u8]) -> Result<Self, ProtocolError>
       where Self: Sized;

    // Provided method
    fn from_protocol(raw: &[u8], format: Format) -> Result<Self, ProtocolError>
       where Self: Sized { ... }
}
Expand description

This trait explains how to decode values from the protocol It’s used in the Bind message

Required Methods§

Source

fn from_text(raw: &[u8]) -> Result<Self, ProtocolError>
where Self: Sized,

Decodes raw value to native type in text format

Source

fn from_binary(raw: &[u8]) -> Result<Self, ProtocolError>
where Self: Sized,

Decodes raw value to native type in binary format

Provided Methods§

Source

fn from_protocol(raw: &[u8], format: Format) -> Result<Self, ProtocolError>
where Self: Sized,

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl FromProtocolValue for bool

Source§

impl FromProtocolValue for f64

Source§

impl FromProtocolValue for i64

Source§

impl FromProtocolValue for String

Implementors§