diff --git a/docs/rust-binary-router-library-design.md b/docs/rust-binary-router-library-design.md
index 81f06138..0f22aad4 100644
--- a/docs/rust-binary-router-library-design.md
+++ b/docs/rust-binary-router-library-design.md
@@ -1120,65 +1120,62 @@ examples are invaluable. They make the abstract design tangible and showcase how
}
```
- 2. **Frame Processor Implementation** (Simple Length-Prefixed Framing using
- `tokio-util`):
+1. **Frame Processor Implementation** (Simple length-prefixed framing using
+ `tokio-util`; invalid input or oversized frames return `io::Error` from both
+ decode and encode):
- ```rust
- // Crate: my_frame_processor.rs
- use bytes::{BytesMut, Buf, BufMut};
- use tokio_util::codec::{Decoder, Encoder};
- use std::io;
+```rust
+// Crate: my_frame_processor.rs
+use bytes::{BytesMut, Buf, BufMut};
+use tokio_util::codec::{Decoder, Encoder};
+use byteorder::{BigEndian, ByteOrder};
+use std::io;
- const MAX_FRAME_LEN: usize = 16 * 1024 * 1024; // 16 MiB upper limit
+const MAX_FRAME_LEN: usize = 16 * 1024 * 1024; // 16 MiB upper limit
- pub struct LengthPrefixedCodec;
+pub struct LengthPrefixedCodec;
- impl Decoder for LengthPrefixedCodec {
- type Item = BytesMut; // Raw frame payload
- type Error = io::Error;
+impl Decoder for LengthPrefixedCodec {
+ type Item = BytesMut; // Raw frame payload
+ type Error = io::Error;
- fn decode(&mut self, src: &mut BytesMut) -> Result