Fix build errors: FTPS AsyncRead bridge, TLS connector type, unsafe env::set_var, dead code
Verified with cargo check + cargo run --example printer_polymorphism.
This commit is contained in:
+6
-1
@@ -54,7 +54,12 @@ pub trait Printer {
|
||||
/// REQUIRED, no default body: every printer vendor speaks a different
|
||||
/// protocol, so there's nothing sensible to share here. Each `impl`
|
||||
/// below provides a completely different body — that's the "override".
|
||||
async fn connect(&mut self) -> Result<(), PrinterError>;
|
||||
///
|
||||
/// Spelled as `-> impl Future<..> + Send` rather than plain `async fn`
|
||||
/// so the resulting future is `Send` and can be `.await`ed inside a
|
||||
/// `tokio::spawn`ed task; each `impl` below still just writes a normal
|
||||
/// `async fn` body, which satisfies this signature automatically.
|
||||
fn connect(&mut self) -> impl std::future::Future<Output = Result<(), PrinterError>> + Send;
|
||||
|
||||
/// OPTIONAL: a default body every printer gets for free unless it
|
||||
/// chooses to provide its own. None of ours do, so all three vendors
|
||||
|
||||
Reference in New Issue
Block a user