diff --git a/bin-proto-derive/Cargo.toml b/bin-proto-derive/Cargo.toml index e22a739..399919a 100644 --- a/bin-proto-derive/Cargo.toml +++ b/bin-proto-derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bin-proto-derive" -version = "0.4.2" +version = "0.5.0" authors = [ "Wojciech Graj ", "Dylan McKay " diff --git a/bin-proto/Cargo.toml b/bin-proto/Cargo.toml index 5d181b6..0806f62 100644 --- a/bin-proto/Cargo.toml +++ b/bin-proto/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bin-proto" -version = "0.4.2" +version = "0.5.0" authors = [ "Wojciech Graj ", "Dylan McKay " @@ -20,6 +20,6 @@ default = ["derive"] derive = ["bin-proto-derive"] [dependencies] -bin-proto-derive = { version = "0.4.2", path = "../bin-proto-derive", optional = true } +bin-proto-derive = { version = "0.5.0", path = "../bin-proto-derive", optional = true } bitstream-io = "2.3.0" thiserror = "1.0.61" diff --git a/bin-proto/src/discriminable.rs b/bin-proto/src/discriminable.rs index bb95599..3f57a5c 100644 --- a/bin-proto/src/discriminable.rs +++ b/bin-proto/src/discriminable.rs @@ -1,4 +1,4 @@ -/// A trait for types with discriminants (typically Enums). +/// A trait for types with discriminants. Automatically derived for `enum`s. pub trait Discriminable { type Discriminant; diff --git a/bin-proto/src/lib.rs b/bin-proto/src/lib.rs index 45b7af6..8010d2d 100644 --- a/bin-proto/src/lib.rs +++ b/bin-proto/src/lib.rs @@ -108,7 +108,7 @@ pub use self::tagged::{TaggedRead, UntaggedWrite}; /// /// Determine width of field in bits. /// -/// **WARNING**: Bitfields disregard ByteOrder and instead have the same +/// **WARNING**: Bitfields disregard `ByteOrder` and instead have the same /// endianness as the underlying `BitRead` / `BitWrite` instance. If you're /// using bitfields, you almost always want a big endian stream. /// @@ -187,9 +187,9 @@ pub use self::tagged::{TaggedRead, UntaggedWrite}; /// } /// ``` /// -/// ## `[#protocol(ctx = "")]` +/// ## `[#protocol(ctx = "")]` /// - Applies to: containers -/// - ``: The type of the context. Either a concrete type, or one of the +/// - ``: The type of the context. Either a concrete type, or one of the /// container's generics /// /// Specify the type of context that will be passed to codec functions diff --git a/bin-proto/src/tagged.rs b/bin-proto/src/tagged.rs index 5cdac3d..0e85996 100644 --- a/bin-proto/src/tagged.rs +++ b/bin-proto/src/tagged.rs @@ -2,13 +2,13 @@ use crate::{BitRead, BitWrite, ByteOrder, Result}; -/// A trait for variable-length types with a disjoint length prefix. +/// A trait for decoding variable-length types with a disjoint length prefix. pub trait TaggedRead: Sized { fn read(read: &mut dyn BitRead, byte_order: ByteOrder, ctx: &mut Ctx, tag: Tag) -> Result; } -/// A trait for variable-length types with a disjoint length prefix. +/// A trait for encoding variable-length types with a disjoint length prefix. pub trait UntaggedWrite: Sized { fn write(&self, write: &mut dyn BitWrite, byte_order: ByteOrder, ctx: &mut Ctx) -> Result<()>; }