Skip to main content

InterfaceSink

Trait InterfaceSink 

Source
pub trait InterfaceSink {
    // Required methods
    fn send_ty<T: Serialize>(
        &mut self,
        hdr: &HeaderSeq,
        body: &T,
    ) -> Result<(), ()>;
    fn send_raw(&mut self, hdr: &HeaderSeq, body: &[u8]) -> Result<(), ()>;
    fn send_err(
        &mut self,
        hdr: &HeaderSeq,
        err: ProtocolError,
    ) -> Result<(), ()>;
}
Expand description

The “Sink” side of the interface.

This is typically held by a profile, and feeds data to the interface’s TX worker.

Required Methods§

Source

fn send_ty<T: Serialize>(&mut self, hdr: &HeaderSeq, body: &T) -> Result<(), ()>

Source

fn send_raw(&mut self, hdr: &HeaderSeq, body: &[u8]) -> Result<(), ()>

Source

fn send_err(&mut self, hdr: &HeaderSeq, err: ProtocolError) -> Result<(), ()>

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<Q> InterfaceSink for ergot::interface_manager::utils::cobs_stream::Sink<Q>
where Q: BbqHandle,

Source§

impl<Q> InterfaceSink for ergot::interface_manager::utils::framed_stream::Sink<Q>
where Q: BbqHandle,