Trait Request

Source
pub trait Request {
    type Response: Sized;

    const TYPE: IProtoType;

    // Required methods
    fn encode_body(&self, out: &mut impl Write) -> Result<(), Error>;
    fn decode_response_body(
        in: &mut Cursor<Vec<u8>>,
    ) -> Result<Self::Response, Error>;

    // Provided methods
    fn encode_header(
        &self,
        out: &mut impl Write,
        sync: SyncIndex,
    ) -> Result<(), Error> { ... }
    fn encode(&self, out: &mut impl Write, sync: SyncIndex) -> Result<(), Error> { ... }
}

Required Associated Constants§

Required Associated Types§

Required Methods§

Source

fn encode_body(&self, out: &mut impl Write) -> Result<(), Error>

Source

fn decode_response_body( in: &mut Cursor<Vec<u8>>, ) -> Result<Self::Response, Error>

Provided Methods§

Source

fn encode_header( &self, out: &mut impl Write, sync: SyncIndex, ) -> Result<(), Error>

Source

fn encode(&self, out: &mut impl Write, sync: SyncIndex) -> Result<(), Error>

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.

Implementors§

Source§

impl Request for Auth<'_, '_, '_>

Source§

const TYPE: IProtoType = IProtoType::Auth

Source§

type Response = ()

Source§

impl Request for Ping

Source§

const TYPE: IProtoType = IProtoType::Ping

Source§

type Response = ()

Source§

impl<T> Request for Call<'_, '_, T>
where T: ToTupleBuffer + ?Sized,

Source§

const TYPE: IProtoType = IProtoType::Call

Source§

type Response = Tuple

Source§

impl<T> Request for Delete<'_, T>
where T: ToTupleBuffer + ?Sized,

Source§

const TYPE: IProtoType = IProtoType::Delete

Source§

type Response = Option<Tuple>

Source§

impl<T> Request for Eval<'_, '_, T>
where T: ToTupleBuffer + ?Sized,

Source§

const TYPE: IProtoType = IProtoType::Eval

Source§

type Response = Tuple

Source§

impl<T> Request for Execute<'_, '_, T>
where T: ToTupleBuffer + ?Sized,

Source§

const TYPE: IProtoType = IProtoType::Execute

Source§

type Response = Vec<Tuple>

Source§

impl<T> Request for Insert<'_, T>
where T: ToTupleBuffer + ?Sized,

Source§

const TYPE: IProtoType = IProtoType::Insert

Source§

type Response = Option<Tuple>

Source§

impl<T> Request for Replace<'_, T>
where T: ToTupleBuffer + ?Sized,

Source§

const TYPE: IProtoType = IProtoType::Replace

Source§

type Response = Option<Tuple>

Source§

impl<T> Request for Select<'_, T>
where T: ToTupleBuffer + ?Sized,

Source§

const TYPE: IProtoType = IProtoType::Select

Source§

type Response = Vec<Tuple>

Source§

impl<T, Op> Request for Update<'_, T, Op>
where T: ToTupleBuffer + ?Sized, Op: Encode,

Source§

const TYPE: IProtoType = IProtoType::Update

Source§

type Response = Option<Tuple>

Source§

impl<T, Op> Request for Upsert<'_, T, Op>
where T: ToTupleBuffer + ?Sized, Op: Encode,

Source§

const TYPE: IProtoType = IProtoType::Upsert

Source§

type Response = Option<Tuple>