base64-ng-tokio
Optional Tokio helpers for base64-ng.
The current companion crate provides async convenience helpers plus manual
AsyncRead and AsyncWrite streaming adapters. Use the *_limited helper
variants when input size is controlled by a peer or request boundary. Writer
shutdown is the finalization boundary: call AsyncWriteExt::shutdown to encode
or validate a final partial quantum.
Read-all helper allocations are RAII-wiped on success, error, and cancellation. Limited helpers consume no more than the configured limit plus one lookahead byte used to detect overflow. Use a separately bounded reader or a streaming adapter when an adjacent frame's first byte must remain unread. Their eager allocation is capped at 8 KiB so cleanup work stays proportional to accepted input rather than the caller's maximum alone. Guarded vector growth wipes each replaced allocation before it is returned to the allocator.
use STANDARD;
use ;
use ;
let mut input = &b"hello";
let mut output = Vecnew;
encode_reader_to_writer_limited.await.unwrap;
assert_eq!;
let mut reader = new;
let mut streamed = Vecnew;
reader.read_to_end.await.unwrap;
assert_eq!;
let mut writer = new;
writer.write_all.await.unwrap;
writer.shutdown.await.unwrap;
assert_eq!;