pub trait Encode {
// Required method
fn encode(&self) -> Result<Value, EncodeError>;
}Expand description
Encode a single value to be sent to the database.
Required Methods§
Sourcefn encode(&self) -> Result<Value, EncodeError>
fn encode(&self) -> Result<Value, EncodeError>
Writes the value of self into buf in the expected format for the database.
Takes &self to avoid consuming the value, allowing for more flexible usage patterns.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Implementors§
impl Encode for Date
impl Encode for OffsetDateTime
impl Encode for PrimitiveDateTime
impl Encode for Time
impl Encode for VecBit
Available on crate feature
vec only.impl Encode for VecF32
Available on crate feature
vec only.impl Encode for VecInt8
Available on crate feature
vec only.