Skip to main content

MessageTransport

Trait MessageTransport 

Source
pub trait MessageTransport {
    type Message: Debug;
    type Error: Debug;

    // Required methods
    fn send(
        &mut self,
        dst: &NodeAddress,
        message: Self::Message,
    ) -> Result<(), Self::Error>;
    fn recv(&mut self) -> Option<(NodeAddress, Self::Message)>;
}
Expand description

High-level transport trait for named message communication.

Application developers building on top of UDS/DoIP use this trait. Messages are typed - the transport handles serialisation internally.

Required Associated Types§

Required Methods§

Source

fn send( &mut self, dst: &NodeAddress, message: Self::Message, ) -> Result<(), Self::Error>

Sends a typed message to the given destination

Source

fn recv(&mut self) -> Option<(NodeAddress, Self::Message)>

Receives the next available typed message, if any.

Implementors§