diff --git a/volo-thrift/src/codec/default/mod.rs b/volo-thrift/src/codec/default/mod.rs index 2e48297d..9bfb7813 100644 --- a/volo-thrift/src/codec/default/mod.rs +++ b/volo-thrift/src/codec/default/mod.rs @@ -43,8 +43,9 @@ use crate::{context::ThriftContext, EntryMessage, ThriftMessage}; pub mod framed; pub mod thrift; pub mod ttheader; -// mod mesh_header; +/// Trait for encoding a [`ThriftMessage`] in place. +/// /// [`ZeroCopyEncoder`] tries to encode a message without copying large data taking the advantage /// of [`LinkedBytes`], which can insert a [`Bytes`] into the middle of a [`bytes::BytesMut`] and /// uses writev. @@ -74,6 +75,8 @@ pub trait ZeroCopyEncoder: Send + Sync + 'static { ) -> Result<(usize, usize), ThriftException>; } +/// Trait for decoding a [`ThriftMessage`] in place. +/// /// [`ZeroCopyDecoder`] tries to decode a message without copying large data, so the [`Bytes`] in /// the `decode` method is not designed to be reused, and the implementation can use /// `Bytes::split_to` to get a [`Bytes`] and hand it to the user directly. diff --git a/volo/src/discovery/mod.rs b/volo/src/discovery/mod.rs index d2e05371..f52345c9 100644 --- a/volo/src/discovery/mod.rs +++ b/volo/src/discovery/mod.rs @@ -63,6 +63,8 @@ pub struct Change { pub removed: Vec>, } +/// Get the difference of two address lists. +/// /// [`diff_address`] provides a naive implementation that compares prev and next only by the /// address, and returns the [`Change`], which means that the `updated` is always empty when using /// this implementation.