pub trait Receiver<T: Send + 'static> {
// Required methods
fn request(
func: String,
data: Vec<u8>,
app_data: Arc<Mutex<T>>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send>>;
fn get_app_data(&self) -> Arc<Mutex<T>>;
// Provided methods
async fn start_from_listener(
&self,
listener: TcpListener,
magic_header: &str,
) -> Result<()> { ... }
async fn start(&self, port: u16, magic_header: &str) -> Result<()> { ... }
}
Required Methods§
fn request( func: String, data: Vec<u8>, app_data: Arc<Mutex<T>>, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send>>
fn get_app_data(&self) -> Arc<Mutex<T>>
Provided Methods§
async fn start_from_listener( &self, listener: TcpListener, magic_header: &str, ) -> Result<()>
async fn start(&self, port: u16, magic_header: &str) -> 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.