diff --git a/tokio-util/src/udp/frame.rs b/tokio-util/src/udp/frame.rs index 84a8096dc..c0719bce3 100644 --- a/tokio-util/src/udp/frame.rs +++ b/tokio-util/src/udp/frame.rs @@ -22,6 +22,12 @@ use std::{ /// handle encoding and decoding of messages frames. Note that the incoming and /// outgoing frame types may be distinct. /// +/// A single datagram may decode into multiple frames. `UdpFramed` will keep +/// calling [`Decoder::decode_eof`] with the current datagram until it returns +/// `Ok(None)`. If a decoder wants to discard a malformed datagram and continue +/// receiving later datagrams, it should consume or clear the remaining bytes +/// from the buffer before returning `Err`. +/// /// This function returns a *single* object that is both [`Stream`] and [`Sink`]; /// grouping this into a single object is often useful for layering things which /// require both read and write access to the underlying object.