consensus_encoding: Document freestanding functions
What changed, and why it matters
This commit only updates the crate-level documentation in the consensus_encoding module. It expands the list of free-standing encoding and decoding functions with brief descriptions. No code behavior was changed.
No action required. This is a documentation-only change with no security relevance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies only doc comments in consensus_encoding/src/lib.rs. It replaces a short bullet list of driver functions with a more complete, categorized list covering decode_from_read, decode_from_read_unbuffered, decode_from_read_unbuffered_with, decode_from_slice, decode_from_slice_unbounded, encode_to_writer, flush_to_writer, encode_to_vec, and flush_to_vec. No executable code, signatures, or logic were altered.
Changed components
consensus_encoding/src/lib.rs documentationInspect captured patch +14 / −3
diff --git a/consensus_encoding/src/lib.rs b/consensus_encoding/src/lib.rs
index c8d634f2..ac9d5032 100644
--- a/consensus_encoding/src/lib.rs
+++ b/consensus_encoding/src/lib.rs
@@ -32,10 +32,21 @@
//!
//! # Drivers
//!
-//! This crate provides free functions which drive codecs for common I/O interfaces.
+//! This crate provides free functions which drive codecs for common I/O interfaces. On the decoding
+//! side we provide:
//!
-//! * [`decode_from_read`] / [`encode_to_writer`] - std library.
-//! * [`decode_from_slice`] / [`encode_to_vec`] - Memory allocations.
+//! * [`decode_from_read`]: Decode from a stblib buffered reader.
+//! * [`decode_from_read_unbuffered`]: Decode from a stdlib unbuffered reader (4k buffer on stack).
+//! * [`decode_from_read_unbuffered_with`]: As above with custom sized stack-allocated buffer.
+//! * [`decode_from_slice`]: Decode from a byte slice (errors if slice is not completely consumed).
+//! * [`decode_from_slice_unbounded`]: Slice can contain additional data after decoding completes.
+//!
+//! And on the encoding side we provide:
+//!
+//! * [`encode_to_writer`]: Encode to a stdlib writer.
+//! * [`flush_to_writer`]: Flush an encoder to a stdlib writer.
+//! * [`encode_to_vec`]: Encode to the heap.
+//! * [`flush_to_vec`]: Flush an encoder to the heap.
//!
//! # Feature Flags
//!
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.