Trait InterfaceSink

Source
pub trait InterfaceSink {
    // Required methods
    fn send_ty<T: Serialize>(
        &mut self,
        hdr: &CommonHeader,
        apdx: Option<&AnyAllAppendix>,
        body: &T,
    ) -> Result<(), ()>;
    fn send_raw(
        &mut self,
        hdr: &CommonHeader,
        hdr_raw: &[u8],
        body: &[u8],
    ) -> Result<(), ()>;
    fn send_err(
        &mut self,
        hdr: &CommonHeader,
        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: &CommonHeader, apdx: Option<&AnyAllAppendix>, body: &T, ) -> Result<(), ()>

Source

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

Source

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

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<Q> InterfaceSink for ergot_base::interface_manager::utils::cobs_stream::Sink<Q>
where Q: BbqHandle,

Source§

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