summaryrefslogtreecommitdiff
path: root/src/codec/decode.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/codec/decode.rs')
-rw-r--r--src/codec/decode.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/codec/decode.rs b/src/codec/decode.rs
index 31ed725..fa4ae95 100644
--- a/src/codec/decode.rs
+++ b/src/codec/decode.rs
@@ -1,3 +1,4 @@
+//! Decoding: reading protocol values from a byte stream.
use std::{io::Read, sync::Arc};
use crate::{DEFAULT_BUFFER_LEN, codec::error::Result};
@@ -5,6 +6,7 @@ use crate::{DEFAULT_BUFFER_LEN, codec::error::Result};
macro_rules! impl_decode {
($type: ty) => {
impl<Ctx> Decode<Ctx> for $type {
+ // decode number using big endian
fn decode(reader: &mut dyn Read, _: &mut Ctx) -> Result<Self>
where
Self: Sized,
@@ -18,6 +20,7 @@ macro_rules! impl_decode {
};
}
+/// Read a value from a byte stream
pub trait Decode<Ctx> {
fn decode(reader: &mut dyn Read, ctx: &mut Ctx) -> Result<Self>
where