serialization: remove #[cfg(doc)]

This commit is contained in:
AF 2023-07-30 11:32:35 +00:00
parent 3c57edba2d
commit 3306849de9

View File

@ -1,6 +1,3 @@
#[cfg(doc)]
use super::*;
/// Serialisation mechanism that is chosen over bytestring concatenation /// Serialisation mechanism that is chosen over bytestring concatenation
/// both for performance and simplicity. /// both for performance and simplicity.
/// ///
@ -8,7 +5,9 @@ use super::*;
pub trait Serializer { pub trait Serializer {
/// Writes bytes from a slice. Should advance value of [`Serializer::tell()`] by `buf.len()`. /// Writes bytes from a slice. Should advance value of [`Serializer::tell()`] by `buf.len()`.
fn write(&mut self, buf: &[u8]); fn write(&mut self, buf: &[u8]);
/// Current position of the stream. Used by [`crate::rstd::inlining::CheckedSerialize`]. /// Current position of the stream. Used by [`CheckedSerialize`].
///
/// [`CheckedSerialize`]: crate::rstd::inlining::CheckedSerialize
fn tell(&self) -> usize; fn tell(&self) -> usize;
} }
@ -31,6 +30,8 @@ impl Serializer for Vec<u8> {
/// Trait representing a readable stream used for parsing. /// Trait representing a readable stream used for parsing.
/// ///
/// See [`Serializer`], [`FactoryParse::deserialize`]. /// See [`Serializer`], [`FactoryParse::deserialize`].
///
/// [`FactoryParse::deserialize`]: super::FactoryParse::deserialize
pub trait Deserializer { pub trait Deserializer {
/// Read at most `n` bytes. /// Read at most `n` bytes.
fn read_n(&mut self, n: usize) -> &[u8]; fn read_n(&mut self, n: usize) -> &[u8];