Skip to main content

Module sink

Module sink 

Source
Expand description

The byte-sink abstraction shared by the synchronous and asynchronous write APIs.

pdfboss-write keeps exactly one implementation of file emission — the algorithm behind crate::Writer::finish_into_with — and several ways of accepting its bytes. AsyncByteSink is what an asynchronous consumer provides; Vec<u8> is a sink in its own right for the in-memory path; Immediate presents any std::io::Write as a sink whose futures are already complete, which is how the synchronous entry points share the asynchronous implementation through pdfboss_core::block_on — exactly the pattern the read side’s pdfboss_core::source module documents.

Emission follows that module’s three signing rules, mirrored for writing: entry points take the sink by value, carry no Send/Sync bounds of their own, and call the trait method rather than a free twin.

Structs§

Immediate
Presents a synchronous std::io::Write as an AsyncByteSink whose futures are already complete.

Traits§

AsyncByteSink
Accepts emitted file bytes, awaiting whatever I/O that takes.