edgedb-protocol 0.6.0

Low-level protocol implemenentation for EdgeDB database client. Use edgedb-tokio for applications instead.
Documentation
use chrono::{DateTime, NaiveDateTime, NaiveDate, NaiveTime, Utc};
use crate::errors::DecodeError;
use crate::serialization::decode::raw_scalar::RawCodec;


impl<'t> RawCodec<'t> for DateTime<Utc> {
    fn decode(buf: &[u8]) -> Result<Self, DecodeError> {
        crate::model::Datetime::decode(buf).map(Into::into)
    }
}

impl<'t> RawCodec<'t> for NaiveDateTime {
    fn decode(buf: &[u8]) -> Result<Self, DecodeError> {
        crate::model::LocalDatetime::decode(buf).map(Into::into)
    }
}

impl<'t> RawCodec<'t> for NaiveDate {
    fn decode(buf: &[u8]) -> Result<Self, DecodeError> {
        crate::model::LocalDate::decode(buf).map(Into::into)
    }
}

impl<'t> RawCodec<'t> for NaiveTime {
    fn decode(buf: &[u8]) -> Result<Self, DecodeError> {
        crate::model::LocalTime::decode(buf).map(Into::into)
    }
}