Skip to main content

ToBinary

Trait ToBinary 

Source
pub trait ToBinary {
    // Required method
    fn to_binary_with_type(&self, ty: &DataType) -> Result<Bytes, ToBinaryError>;
}
Expand description

Converts ScalarRef to pgwire “BINARY” format.

[postgres_types::ToSql] has similar functionality, and most of our types implement that trait and forward ToBinary to it directly.

Required Methods§

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl ToBinary for &[u8]

Source§

impl ToBinary for &str

Source§

impl ToBinary for bool

Source§

impl ToBinary for i16

Source§

impl ToBinary for i32

Source§

impl ToBinary for i64

Implementors§