pub trait Encode {
// Required methods
fn encode(&self, dst: &mut WriteCursor<'_>) -> EncodeResult<()>;
fn name(&self) -> &'static str;
fn size(&self) -> usize;
}
Expand description
PDU that can be encoded into its binary form.
The resulting binary payload is a fully encoded PDU that may be sent to the peer.
This trait is object-safe and may be used in a dynamic context.
Required Methods§
Sourcefn encode(&self, dst: &mut WriteCursor<'_>) -> EncodeResult<()>
fn encode(&self, dst: &mut WriteCursor<'_>) -> EncodeResult<()>
Encodes this PDU in-place using the provided WriteCursor
.