Trait ReadAtomic

Source
pub trait ReadAtomic: ErrorType {
    // Required method
    fn read_atomic<T, F>(
        &self,
        f: F,
    ) -> impl Future<Output = Result<T, MqttPacketError>>
       where F: Fn(&dyn BufferReader) -> Result<Option<T>, MqttPacketError>;

    // Provided method
    fn read_mqtt_packet<O, R>(
        &self,
        o: O,
    ) -> impl Future<Output = Result<R, MqttPacketError>>
       where O: Fn(&Packet<'_>) -> R { ... }
}

Required Methods§

Source

fn read_atomic<T, F>( &self, f: F, ) -> impl Future<Output = Result<T, MqttPacketError>>
where F: Fn(&dyn BufferReader) -> Result<Option<T>, MqttPacketError>,

Provided Methods§

Source

fn read_mqtt_packet<O, R>( &self, o: O, ) -> impl Future<Output = Result<R, MqttPacketError>>
where O: Fn(&Packet<'_>) -> R,

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<'a, const N: usize> ReadAtomic for ServerConnection<'a, N>

Source§

impl<const N: usize> ReadAtomic for BufferedStream<N>