Trait ContextStack

Source
pub trait ContextStack {
    type Name: ?Sized;
    type Frame: Framing;

    // Required methods
    fn pre_read(&mut self) -> Result<(), Error>;
    fn on_read_data(
        &mut self,
        msg: SerializedMessage<'_, Self::Name, FramingDecoded<Self::Frame>>,
    ) -> Result<(), Error>;
    fn post_read(&mut self, bytes: u32) -> Result<(), Error>;
    fn pre_write(&mut self) -> Result<(), Error>;
    fn on_write_data(
        &mut self,
        msg: SerializedMessage<'_, Self::Name, FramingEncodedFinal<Self::Frame>>,
    ) -> Result<(), Error>;
    fn post_write(&mut self, bytes: u32) -> Result<(), Error>;
}

Required Associated Types§

Source

type Name: ?Sized

Type for method names

Source

type Frame: Framing

Type for serialized read and write buffers

Required Methods§

Source

fn pre_read(&mut self) -> Result<(), Error>

Called before the request is read.

Source

fn on_read_data( &mut self, msg: SerializedMessage<'_, Self::Name, FramingDecoded<Self::Frame>>, ) -> Result<(), Error>

Called before post_read after reading arguments (server) / after reading reply (client), with the actual (unparsed, serialized) data.

Source

fn post_read(&mut self, bytes: u32) -> Result<(), Error>

Called after the request is read.

Source

fn pre_write(&mut self) -> Result<(), Error>

Called before a response is written.

Source

fn on_write_data( &mut self, msg: SerializedMessage<'_, Self::Name, FramingEncodedFinal<Self::Frame>>, ) -> Result<(), Error>

Called before post_write, after serializing response (server) / after serializing request (client), with the actual (serialized) data.

Source

fn post_write(&mut self, bytes: u32) -> Result<(), Error>

Called after a response a written.

Implementors§

Source§

impl<Name: ?Sized, Frame: Framing> ContextStack for DummyContextStack<Name, Frame>

Source§

type Name = Name

Source§

type Frame = Frame