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§
fn read_atomic<T, F>( &self, f: F, ) -> impl Future<Output = Result<T, MqttPacketError>>
Provided Methods§
fn read_mqtt_packet<O, R>( &self, o: O, ) -> impl Future<Output = Result<R, MqttPacketError>>
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.