Module bio

Module bio 

Source
Expand description

BIO wrappers — MemBio, MemBioBuf<'a>, Bio, BorrowedBio<'_>.

BIOs are OpenSSL’s generic I/O abstraction. This module exposes four types:

  • MemBio — a writable, growable in-memory BIO (BIO_s_mem()). Used for encoding output (PEM, DER). Call data() after writing to read the result as a &[u8] slice without copying.

  • MemBioBuf<'a> — a read-only view of a caller-supplied slice (BIO_new_mem_buf()). Zero-copy input path for PEM parsing.

  • Bio — shared ownership wrapper around a raw BIO*. Used when OpenSSL needs a BIO that outlives the immediate call (e.g. TLS SSL_set_bio). Supports read/write I/O and BIO chain operations.

  • BorrowedBio<'_> — a non-owning view of a BIO* returned by chain walk operations (BIO_next, BIO_find_type). Does not free on drop.

Structs§

Bio
Shared ownership wrapper around a BIO*.
BorrowedBio
A non-owning view of a BIO* returned by chain walk operations.
MemBio
A writable, growable in-memory BIO.
MemBioBuf
A read-only BIO wrapping a borrowed byte slice (BIO_new_mem_buf()).