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:
2026-08-28 17:09:11 +00:00
parent 03bd07fbd7
commit 9b3815fd25
7 changed files with 27 additions and 23 deletions
+6 -1
View File
@@ -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