Skip to main content

Module stream

Module stream 

Source
Expand description

Lifetime-bound stream over a borrowed Adapter.

AdapterStream wraps a &mut Adapter reference, so it borrows the adapter exclusively for its entire lifetime. This is the lowest-overhead way to use the stack when all of the following are true:

  • You open one connection at a time on the adapter.
  • The stream lives entirely within a single async task.
  • You do not need to store the stream alongside other owned data in a struct (the lifetime parameter 'a would appear in the struct definition).

If any of those constraints are inconvenient, use crate::tcp::handle::AdapterHandle / crate::tcp::handle::StreamHandle instead.

Structsยง

AdapterStream