diff --git a/CHANGELOG.md b/CHANGELOG.md index 93be9db5..2e1a58e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,26 @@ -# Unreleased +# 0.4.0 - 2026-03-05 + +This release is the `v1.1.0` release candidate. We use 'normal' +version numbers for our RCs so that we can iterate following normal +semver rules and downstream has some chance of staying sane. + +`v1.0` of this crate only has the decoding side (and the decoding +iterator is private). + +This next release introduces the encoding side of the library and also +makes the iterators public - enjoy. There were no material changes to +the `0.3.2` release other than: + +- Align `fmt_hex_exact` and `Display` impls [#127](https://github.com/rust-bitcoin/hex-conservative/pull/127) + +# 0.3.2 - 2026-01-28 - Add `hex!` macro for const hex literal parsing. +# 0.3.1 - 2025-11-24 + +- Remove `doc_auto_cfg` because it breaks the docs builds on crates.io + # 0.3.0 - 2024-09-18 - Re-implement `HexWriter` [#113](https://github.com/rust-bitcoin/hex-conservative/pull/113) diff --git a/Cargo-minimal.lock b/Cargo-minimal.lock index a2b216a0..2d807e55 100644 --- a/Cargo-minimal.lock +++ b/Cargo-minimal.lock @@ -10,7 +10,7 @@ checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" [[package]] name = "hex-conservative" -version = "0.3.0" +version = "0.4.0" dependencies = [ "arrayvec", "if_rust_version", diff --git a/Cargo-recent.lock b/Cargo-recent.lock index 636f2f87..346c2c39 100644 --- a/Cargo-recent.lock +++ b/Cargo-recent.lock @@ -10,7 +10,7 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "hex-conservative" -version = "0.3.0" +version = "0.4.0" dependencies = [ "arrayvec", "if_rust_version", diff --git a/Cargo.toml b/Cargo.toml index 80a5424d..2860f93c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hex-conservative" -version = "0.3.0" +version = "0.4.0" authors = ["Martin Habovštiak ", "Andrew Poelstra "] license = "CC0-1.0" repository = "https://github.com/rust-bitcoin/hex-conservative" @@ -45,10 +45,6 @@ name = "hexy" [[example]] name = "wrap_array" -[[example]] -name = "serde" -required-features = ["std", "serde"] - [lints.clippy] # Exclude lints we don't think are valuable. needless_question_mark = "allow" # https://github.com/rust-bitcoin/rust-bitcoin/pull/2134 diff --git a/api/all-features.txt b/api/all-features.txt new file mode 100644 index 00000000..f9f02dd9 --- /dev/null +++ b/api/all-features.txt @@ -0,0 +1,409 @@ +impl core::clone::Clone for hex_conservative::Case +impl core::clone::Clone for hex_conservative::error::DecodeFixedLengthBytesError +impl core::clone::Clone for hex_conservative::error::DecodeVariableLengthBytesError +impl core::clone::Clone for hex_conservative::error::InvalidCharError +impl core::clone::Clone for hex_conservative::error::InvalidLengthError +impl core::clone::Clone for hex_conservative::error::OddLengthStringError +impl core::cmp::Eq for hex_conservative::Case +impl core::cmp::Eq for hex_conservative::error::DecodeFixedLengthBytesError +impl core::cmp::Eq for hex_conservative::error::DecodeVariableLengthBytesError +impl core::cmp::Eq for hex_conservative::error::InvalidCharError +impl core::cmp::Eq for hex_conservative::error::InvalidLengthError +impl core::cmp::Eq for hex_conservative::error::OddLengthStringError +impl core::cmp::PartialEq for hex_conservative::Case +impl core::cmp::PartialEq for hex_conservative::error::DecodeFixedLengthBytesError +impl core::cmp::PartialEq for hex_conservative::error::DecodeVariableLengthBytesError +impl core::cmp::PartialEq for hex_conservative::error::InvalidCharError +impl core::cmp::PartialEq for hex_conservative::error::InvalidLengthError +impl core::cmp::PartialEq for hex_conservative::error::OddLengthStringError +impl core::convert::From for hex_conservative::error::DecodeFixedLengthBytesError +impl core::convert::From for hex_conservative::error::DecodeVariableLengthBytesError +impl core::convert::From for hex_conservative::error::InvalidCharError +impl core::convert::From for hex_conservative::error::InvalidLengthError +impl core::convert::From for hex_conservative::error::OddLengthStringError +impl core::convert::From for hex_conservative::error::DecodeFixedLengthBytesError +impl core::convert::From for hex_conservative::error::DecodeVariableLengthBytesError +impl core::convert::From for hex_conservative::error::DecodeFixedLengthBytesError +impl core::convert::From for hex_conservative::error::DecodeVariableLengthBytesError +impl core::default::Default for hex_conservative::Case +impl core::error::Error for hex_conservative::error::DecodeFixedLengthBytesError +impl core::error::Error for hex_conservative::error::DecodeVariableLengthBytesError +impl core::error::Error for hex_conservative::error::InvalidCharError +impl core::error::Error for hex_conservative::error::InvalidLengthError +impl core::error::Error for hex_conservative::error::OddLengthStringError +impl core::fmt::Debug for hex_conservative::Case +impl core::fmt::Debug for hex_conservative::display::DisplayByteSlice<'_> +impl core::fmt::Debug for hex_conservative::error::DecodeFixedLengthBytesError +impl core::fmt::Debug for hex_conservative::error::DecodeVariableLengthBytesError +impl core::fmt::Debug for hex_conservative::error::InvalidCharError +impl core::fmt::Debug for hex_conservative::error::InvalidLengthError +impl core::fmt::Debug for hex_conservative::error::OddLengthStringError +impl core::fmt::Display for hex_conservative::display::DisplayByteSlice<'_> +impl core::fmt::Display for hex_conservative::error::DecodeFixedLengthBytesError +impl core::fmt::Display for hex_conservative::error::DecodeVariableLengthBytesError +impl core::fmt::Display for hex_conservative::error::InvalidCharError +impl core::fmt::Display for hex_conservative::error::InvalidLengthError +impl core::fmt::Display for hex_conservative::error::OddLengthStringError +impl core::fmt::LowerHex for hex_conservative::display::DisplayByteSlice<'_> +impl core::fmt::UpperHex for hex_conservative::display::DisplayByteSlice<'_> +impl core::hash::Hash for hex_conservative::Case +impl core::marker::Copy for hex_conservative::Case +impl core::marker::Freeze for hex_conservative::Case +impl core::marker::Freeze for hex_conservative::error::DecodeFixedLengthBytesError +impl core::marker::Freeze for hex_conservative::error::DecodeVariableLengthBytesError +impl core::marker::Freeze for hex_conservative::error::InvalidCharError +impl core::marker::Freeze for hex_conservative::error::InvalidLengthError +impl core::marker::Freeze for hex_conservative::error::OddLengthStringError +impl core::marker::Send for hex_conservative::Case +impl core::marker::Send for hex_conservative::error::DecodeFixedLengthBytesError +impl core::marker::Send for hex_conservative::error::DecodeVariableLengthBytesError +impl core::marker::Send for hex_conservative::error::InvalidCharError +impl core::marker::Send for hex_conservative::error::InvalidLengthError +impl core::marker::Send for hex_conservative::error::OddLengthStringError +impl core::marker::StructuralPartialEq for hex_conservative::Case +impl core::marker::StructuralPartialEq for hex_conservative::error::DecodeFixedLengthBytesError +impl core::marker::StructuralPartialEq for hex_conservative::error::DecodeVariableLengthBytesError +impl core::marker::StructuralPartialEq for hex_conservative::error::InvalidCharError +impl core::marker::StructuralPartialEq for hex_conservative::error::InvalidLengthError +impl core::marker::StructuralPartialEq for hex_conservative::error::OddLengthStringError +impl core::marker::Sync for hex_conservative::Case +impl core::marker::Sync for hex_conservative::error::DecodeFixedLengthBytesError +impl core::marker::Sync for hex_conservative::error::DecodeVariableLengthBytesError +impl core::marker::Sync for hex_conservative::error::InvalidCharError +impl core::marker::Sync for hex_conservative::error::InvalidLengthError +impl core::marker::Sync for hex_conservative::error::OddLengthStringError +impl core::marker::Unpin for hex_conservative::Case +impl core::marker::Unpin for hex_conservative::error::DecodeFixedLengthBytesError +impl core::marker::Unpin for hex_conservative::error::DecodeVariableLengthBytesError +impl core::marker::Unpin for hex_conservative::error::InvalidCharError +impl core::marker::Unpin for hex_conservative::error::InvalidLengthError +impl core::marker::Unpin for hex_conservative::error::OddLengthStringError +impl core::panic::unwind_safe::RefUnwindSafe for hex_conservative::Case +impl core::panic::unwind_safe::RefUnwindSafe for hex_conservative::error::DecodeFixedLengthBytesError +impl core::panic::unwind_safe::RefUnwindSafe for hex_conservative::error::DecodeVariableLengthBytesError +impl core::panic::unwind_safe::RefUnwindSafe for hex_conservative::error::InvalidCharError +impl core::panic::unwind_safe::RefUnwindSafe for hex_conservative::error::InvalidLengthError +impl core::panic::unwind_safe::RefUnwindSafe for hex_conservative::error::OddLengthStringError +impl core::panic::unwind_safe::UnwindSafe for hex_conservative::Case +impl core::panic::unwind_safe::UnwindSafe for hex_conservative::error::DecodeFixedLengthBytesError +impl core::panic::unwind_safe::UnwindSafe for hex_conservative::error::DecodeVariableLengthBytesError +impl core::panic::unwind_safe::UnwindSafe for hex_conservative::error::InvalidCharError +impl core::panic::unwind_safe::UnwindSafe for hex_conservative::error::InvalidLengthError +impl core::panic::unwind_safe::UnwindSafe for hex_conservative::error::OddLengthStringError +impl hex_conservative::error::DecodeFixedLengthBytesError +impl hex_conservative::error::DecodeVariableLengthBytesError +impl hex_conservative::error::InvalidCharError +impl hex_conservative::error::InvalidLengthError +impl hex_conservative::error::OddLengthStringError +impl<'a, const CAP: usize> core::marker::Freeze for hex_conservative::display::DisplayArray<'a, CAP> +impl<'a, const CAP: usize> core::marker::Send for hex_conservative::display::DisplayArray<'a, CAP> +impl<'a, const CAP: usize> core::marker::Sync for hex_conservative::display::DisplayArray<'a, CAP> +impl<'a, const CAP: usize> core::marker::Unpin for hex_conservative::display::DisplayArray<'a, CAP> +impl<'a, const CAP: usize> core::panic::unwind_safe::RefUnwindSafe for hex_conservative::display::DisplayArray<'a, CAP> +impl<'a, const CAP: usize> core::panic::unwind_safe::UnwindSafe for hex_conservative::display::DisplayArray<'a, CAP> +impl<'a> core::marker::Freeze for hex_conservative::display::DisplayByteSlice<'a> +impl<'a> core::marker::Send for hex_conservative::display::DisplayByteSlice<'a> +impl<'a> core::marker::Sync for hex_conservative::display::DisplayByteSlice<'a> +impl<'a> core::marker::Unpin for hex_conservative::display::DisplayByteSlice<'a> +impl<'a> core::panic::unwind_safe::RefUnwindSafe for hex_conservative::display::DisplayByteSlice<'a> +impl<'a> core::panic::unwind_safe::UnwindSafe for hex_conservative::display::DisplayByteSlice<'a> +impl<'a> hex_conservative::HexToBytesIter> +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 1024] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 10] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 11] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 128] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 12] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 13] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 14] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 15] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 16] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 1] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 2048] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 20] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 256] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 2] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 32] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 33] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 3] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 4096] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 4] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 512] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 5] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 64] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 65] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 6] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 7] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 8] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 9] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8] +impl<'a> hex_conservative::display::DisplayHex for &'a alloc::vec::Vec +impl core::fmt::Debug for hex_conservative::BytesToHexIter where I: core::iter::traits::iterator::Iterator + core::fmt::Debug, ::Item: core::borrow::Borrow +impl core::fmt::Debug for hex_conservative::HexToBytesIter where I: core::iter::traits::iterator::Iterator + core::fmt::Debug +impl core::iter::traits::double_ended::DoubleEndedIterator for hex_conservative::BytesToHexIter where I: core::iter::traits::double_ended::DoubleEndedIterator, ::Item: core::borrow::Borrow +impl core::iter::traits::double_ended::DoubleEndedIterator for hex_conservative::HexToBytesIter where I: core::iter::traits::iterator::Iterator + core::iter::traits::double_ended::DoubleEndedIterator + core::iter::traits::exact_size::ExactSizeIterator +impl core::iter::traits::exact_size::ExactSizeIterator for hex_conservative::BytesToHexIter where I: core::iter::traits::exact_size::ExactSizeIterator, ::Item: core::borrow::Borrow +impl core::iter::traits::exact_size::ExactSizeIterator for hex_conservative::HexToBytesIter where I: core::iter::traits::iterator::Iterator + core::iter::traits::exact_size::ExactSizeIterator +impl core::iter::traits::iterator::Iterator for hex_conservative::BytesToHexIter where I: core::iter::traits::iterator::Iterator, ::Item: core::borrow::Borrow +impl core::iter::traits::iterator::Iterator for hex_conservative::HexToBytesIter where I: core::iter::traits::iterator::Iterator + core::iter::traits::exact_size::ExactSizeIterator +impl core::iter::traits::marker::FusedIterator for hex_conservative::BytesToHexIter where I: core::iter::traits::marker::FusedIterator, ::Item: core::borrow::Borrow +impl core::iter::traits::marker::FusedIterator for hex_conservative::HexToBytesIter where I: core::iter::traits::iterator::Iterator + core::iter::traits::exact_size::ExactSizeIterator + core::iter::traits::marker::FusedIterator +impl core::marker::Freeze for hex_conservative::BytesToHexIter where I: core::marker::Freeze +impl core::marker::Freeze for hex_conservative::HexToBytesIter where I: core::marker::Freeze +impl core::marker::Send for hex_conservative::BytesToHexIter where I: core::marker::Send +impl core::marker::Send for hex_conservative::HexToBytesIter where I: core::marker::Send +impl core::marker::Sync for hex_conservative::BytesToHexIter where I: core::marker::Sync +impl core::marker::Sync for hex_conservative::HexToBytesIter where I: core::marker::Sync +impl core::marker::Unpin for hex_conservative::BytesToHexIter where I: core::marker::Unpin +impl core::marker::Unpin for hex_conservative::HexToBytesIter where I: core::marker::Unpin +impl core::panic::unwind_safe::RefUnwindSafe for hex_conservative::BytesToHexIter where I: core::panic::unwind_safe::RefUnwindSafe +impl core::panic::unwind_safe::RefUnwindSafe for hex_conservative::HexToBytesIter where I: core::panic::unwind_safe::RefUnwindSafe +impl core::panic::unwind_safe::UnwindSafe for hex_conservative::BytesToHexIter where I: core::panic::unwind_safe::UnwindSafe +impl core::panic::unwind_safe::UnwindSafe for hex_conservative::HexToBytesIter where I: core::panic::unwind_safe::UnwindSafe +impl hex_conservative::BytesToHexIter where I: core::iter::traits::iterator::Iterator, ::Item: core::borrow::Borrow +impl hex_conservative::HexToBytesIter where I: core::iter::traits::iterator::Iterator + core::iter::traits::exact_size::ExactSizeIterator +impl std::io::Read for hex_conservative::HexToBytesIter where I: core::iter::traits::iterator::Iterator + core::iter::traits::exact_size::ExactSizeIterator + core::iter::traits::marker::FusedIterator +impl core::fmt::Debug for hex_conservative::display::HexWriter +impl core::marker::Freeze for hex_conservative::display::HexWriter where T: core::marker::Freeze +impl core::marker::Send for hex_conservative::display::HexWriter where T: core::marker::Send +impl core::marker::Sync for hex_conservative::display::HexWriter where T: core::marker::Sync +impl core::marker::Unpin for hex_conservative::display::HexWriter where T: core::marker::Unpin +impl core::panic::unwind_safe::RefUnwindSafe for hex_conservative::display::HexWriter where T: core::panic::unwind_safe::RefUnwindSafe +impl core::panic::unwind_safe::UnwindSafe for hex_conservative::display::HexWriter where T: core::panic::unwind_safe::UnwindSafe +impl hex_conservative::display::HexWriter +impl std::io::Write for hex_conservative::display::HexWriter where T: core::fmt::Write +impl core::default::Default for hex_conservative::buf_encoder::BufEncoder +impl core::fmt::Debug for hex_conservative::buf_encoder::BufEncoder +impl core::marker::Freeze for hex_conservative::buf_encoder::BufEncoder +impl core::marker::Send for hex_conservative::buf_encoder::BufEncoder +impl core::marker::Sync for hex_conservative::buf_encoder::BufEncoder +impl core::marker::Unpin for hex_conservative::buf_encoder::BufEncoder +impl core::panic::unwind_safe::RefUnwindSafe for hex_conservative::buf_encoder::BufEncoder +impl core::panic::unwind_safe::UnwindSafe for hex_conservative::buf_encoder::BufEncoder +impl hex_conservative::buf_encoder::BufEncoder +impl core::fmt::Debug for hex_conservative::display::DisplayArray<'_, LEN> +impl core::fmt::Display for hex_conservative::display::DisplayArray<'_, LEN> +impl core::fmt::LowerHex for hex_conservative::display::DisplayArray<'_, LEN> +impl core::fmt::UpperHex for hex_conservative::display::DisplayArray<'_, LEN> +pub enum hex_conservative::Case +pub enum hex_conservative::DecodeFixedLengthBytesError +pub enum hex_conservative::DecodeVariableLengthBytesError +pub enum hex_conservative::error::DecodeFixedLengthBytesError +pub enum hex_conservative::error::DecodeVariableLengthBytesError +pub fn &'a [u8; 1024]::as_hex(self) -> Self::Display +pub fn &'a [u8; 1024]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 10]::as_hex(self) -> Self::Display +pub fn &'a [u8; 10]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 11]::as_hex(self) -> Self::Display +pub fn &'a [u8; 11]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 128]::as_hex(self) -> Self::Display +pub fn &'a [u8; 128]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 12]::as_hex(self) -> Self::Display +pub fn &'a [u8; 12]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 13]::as_hex(self) -> Self::Display +pub fn &'a [u8; 13]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 14]::as_hex(self) -> Self::Display +pub fn &'a [u8; 14]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 15]::as_hex(self) -> Self::Display +pub fn &'a [u8; 15]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 16]::as_hex(self) -> Self::Display +pub fn &'a [u8; 16]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 1]::as_hex(self) -> Self::Display +pub fn &'a [u8; 1]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 2048]::as_hex(self) -> Self::Display +pub fn &'a [u8; 2048]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 20]::as_hex(self) -> Self::Display +pub fn &'a [u8; 20]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 256]::as_hex(self) -> Self::Display +pub fn &'a [u8; 256]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 2]::as_hex(self) -> Self::Display +pub fn &'a [u8; 2]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 32]::as_hex(self) -> Self::Display +pub fn &'a [u8; 32]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 33]::as_hex(self) -> Self::Display +pub fn &'a [u8; 33]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 3]::as_hex(self) -> Self::Display +pub fn &'a [u8; 3]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 4096]::as_hex(self) -> Self::Display +pub fn &'a [u8; 4096]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 4]::as_hex(self) -> Self::Display +pub fn &'a [u8; 4]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 512]::as_hex(self) -> Self::Display +pub fn &'a [u8; 512]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 5]::as_hex(self) -> Self::Display +pub fn &'a [u8; 5]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 64]::as_hex(self) -> Self::Display +pub fn &'a [u8; 64]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 65]::as_hex(self) -> Self::Display +pub fn &'a [u8; 65]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 6]::as_hex(self) -> Self::Display +pub fn &'a [u8; 6]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 7]::as_hex(self) -> Self::Display +pub fn &'a [u8; 7]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 8]::as_hex(self) -> Self::Display +pub fn &'a [u8; 8]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 9]::as_hex(self) -> Self::Display +pub fn &'a [u8; 9]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8]::as_hex(self) -> Self::Display +pub fn &'a [u8]::hex_reserve_suggestion(self) -> usize +pub fn &'a alloc::vec::Vec::as_hex(self) -> Self::Display +pub fn &'a alloc::vec::Vec::hex_reserve_suggestion(self) -> usize +pub fn hex_conservative::BytesToHexIter::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::BytesToHexIter::len(&self) -> usize +pub fn hex_conservative::BytesToHexIter::new(iter: I, case: hex_conservative::Case) -> hex_conservative::BytesToHexIter +pub fn hex_conservative::BytesToHexIter::next(&mut self) -> core::option::Option +pub fn hex_conservative::BytesToHexIter::next_back(&mut self) -> core::option::Option +pub fn hex_conservative::BytesToHexIter::size_hint(&self) -> (usize, core::option::Option) +pub fn hex_conservative::Case::clone(&self) -> hex_conservative::Case +pub fn hex_conservative::Case::default() -> Self +pub fn hex_conservative::Case::eq(&self, other: &hex_conservative::Case) -> bool +pub fn hex_conservative::Case::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::Case::hash<__H: core::hash::Hasher>(&self, state: &mut __H) +pub fn hex_conservative::DisplayHex::append_hex_to_string(self, case: hex_conservative::Case, string: &mut alloc::string::String) +pub fn hex_conservative::DisplayHex::as_hex(self) -> Self::Display +pub fn hex_conservative::DisplayHex::hex_reserve_suggestion(self) -> usize +pub fn hex_conservative::DisplayHex::to_hex_string(self, case: hex_conservative::Case) -> alloc::string::String +pub fn hex_conservative::DisplayHex::to_lower_hex_string(self) -> alloc::string::String +pub fn hex_conservative::DisplayHex::to_upper_hex_string(self) -> alloc::string::String +pub fn hex_conservative::HexToBytesIter::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::HexToBytesIter::from_pairs(iter: I) -> Self +pub fn hex_conservative::HexToBytesIter::next(&mut self) -> core::option::Option +pub fn hex_conservative::HexToBytesIter::next_back(&mut self) -> core::option::Option +pub fn hex_conservative::HexToBytesIter::nth(&mut self, n: usize) -> core::option::Option +pub fn hex_conservative::HexToBytesIter::nth_back(&mut self, n: usize) -> core::option::Option +pub fn hex_conservative::HexToBytesIter::read(&mut self, buf: &mut [u8]) -> std::io::error::Result +pub fn hex_conservative::HexToBytesIter::size_hint(&self) -> (usize, core::option::Option) +pub fn hex_conservative::HexToBytesIter>::new(s: &'a str) -> core::result::Result +pub fn hex_conservative::buf_encoder::BufEncoder::as_str(&self) -> &str +pub fn hex_conservative::buf_encoder::BufEncoder::clear(&mut self) +pub fn hex_conservative::buf_encoder::BufEncoder::default() -> Self +pub fn hex_conservative::buf_encoder::BufEncoder::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::buf_encoder::BufEncoder::is_full(&self) -> bool +pub fn hex_conservative::buf_encoder::BufEncoder::new(case: hex_conservative::Case) -> Self +pub fn hex_conservative::buf_encoder::BufEncoder::put_byte(&mut self, byte: u8) +pub fn hex_conservative::buf_encoder::BufEncoder::put_bytes(&mut self, bytes: I) where I: core::iter::traits::collect::IntoIterator, ::Item: core::borrow::Borrow +pub fn hex_conservative::buf_encoder::BufEncoder::put_bytes_min<'a>(&mut self, bytes: &'a [u8]) -> &'a [u8] +pub fn hex_conservative::buf_encoder::BufEncoder::space_remaining(&self) -> usize +pub fn hex_conservative::decode_to_array(hex: &str) -> core::result::Result<[u8; N], hex_conservative::error::DecodeFixedLengthBytesError> +pub fn hex_conservative::decode_to_vec(hex: &str) -> core::result::Result, hex_conservative::error::DecodeVariableLengthBytesError> +pub fn hex_conservative::display::DisplayArray<'_, LEN>::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::display::DisplayByteSlice<'_>::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::display::DisplayHex::append_hex_to_string(self, case: hex_conservative::Case, string: &mut alloc::string::String) +pub fn hex_conservative::display::DisplayHex::as_hex(self) -> Self::Display +pub fn hex_conservative::display::DisplayHex::hex_reserve_suggestion(self) -> usize +pub fn hex_conservative::display::DisplayHex::to_hex_string(self, case: hex_conservative::Case) -> alloc::string::String +pub fn hex_conservative::display::DisplayHex::to_lower_hex_string(self) -> alloc::string::String +pub fn hex_conservative::display::DisplayHex::to_upper_hex_string(self) -> alloc::string::String +pub fn hex_conservative::display::HexWriter::flush(&mut self) -> core::result::Result<(), std::io::error::Error> +pub fn hex_conservative::display::HexWriter::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::display::HexWriter::into_inner(self) -> T +pub fn hex_conservative::display::HexWriter::new(dest: T, case: hex_conservative::Case) -> Self +pub fn hex_conservative::display::HexWriter::write(&mut self, buf: &[u8]) -> core::result::Result +pub fn hex_conservative::error::DecodeFixedLengthBytesError::clone(&self) -> hex_conservative::error::DecodeFixedLengthBytesError +pub fn hex_conservative::error::DecodeFixedLengthBytesError::eq(&self, other: &hex_conservative::error::DecodeFixedLengthBytesError) -> bool +pub fn hex_conservative::error::DecodeFixedLengthBytesError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::error::DecodeFixedLengthBytesError::from(e: hex_conservative::error::InvalidCharError) -> Self +pub fn hex_conservative::error::DecodeFixedLengthBytesError::from(e: hex_conservative::error::InvalidLengthError) -> Self +pub fn hex_conservative::error::DecodeFixedLengthBytesError::from(never: core::convert::Infallible) -> Self +pub fn hex_conservative::error::DecodeFixedLengthBytesError::offset(self, by_bytes: usize) -> Self +pub fn hex_conservative::error::DecodeFixedLengthBytesError::source(&self) -> core::option::Option<&(dyn core::error::Error + 'static)> +pub fn hex_conservative::error::DecodeVariableLengthBytesError::clone(&self) -> hex_conservative::error::DecodeVariableLengthBytesError +pub fn hex_conservative::error::DecodeVariableLengthBytesError::eq(&self, other: &hex_conservative::error::DecodeVariableLengthBytesError) -> bool +pub fn hex_conservative::error::DecodeVariableLengthBytesError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::error::DecodeVariableLengthBytesError::from(e: hex_conservative::error::InvalidCharError) -> Self +pub fn hex_conservative::error::DecodeVariableLengthBytesError::from(e: hex_conservative::error::OddLengthStringError) -> Self +pub fn hex_conservative::error::DecodeVariableLengthBytesError::from(never: core::convert::Infallible) -> Self +pub fn hex_conservative::error::DecodeVariableLengthBytesError::offset(self, by_bytes: usize) -> Self +pub fn hex_conservative::error::DecodeVariableLengthBytesError::source(&self) -> core::option::Option<&(dyn core::error::Error + 'static)> +pub fn hex_conservative::error::InvalidCharError::clone(&self) -> hex_conservative::error::InvalidCharError +pub fn hex_conservative::error::InvalidCharError::eq(&self, other: &hex_conservative::error::InvalidCharError) -> bool +pub fn hex_conservative::error::InvalidCharError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::error::InvalidCharError::from(never: core::convert::Infallible) -> Self +pub fn hex_conservative::error::InvalidCharError::offset(self, by_bytes: usize) -> Self +pub fn hex_conservative::error::InvalidCharError::pos(&self) -> usize +pub fn hex_conservative::error::InvalidLengthError::clone(&self) -> hex_conservative::error::InvalidLengthError +pub fn hex_conservative::error::InvalidLengthError::eq(&self, other: &hex_conservative::error::InvalidLengthError) -> bool +pub fn hex_conservative::error::InvalidLengthError::expected_length(&self) -> usize +pub fn hex_conservative::error::InvalidLengthError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::error::InvalidLengthError::from(never: core::convert::Infallible) -> Self +pub fn hex_conservative::error::InvalidLengthError::invalid_length(&self) -> usize +pub fn hex_conservative::error::OddLengthStringError::clone(&self) -> hex_conservative::error::OddLengthStringError +pub fn hex_conservative::error::OddLengthStringError::eq(&self, other: &hex_conservative::error::OddLengthStringError) -> bool +pub fn hex_conservative::error::OddLengthStringError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::error::OddLengthStringError::from(never: core::convert::Infallible) -> Self +pub fn hex_conservative::error::OddLengthStringError::length(&self) -> usize +pub fn hex_conservative::prelude::DisplayHex::append_hex_to_string(self, case: hex_conservative::Case, string: &mut alloc::string::String) +pub fn hex_conservative::prelude::DisplayHex::as_hex(self) -> Self::Display +pub fn hex_conservative::prelude::DisplayHex::hex_reserve_suggestion(self) -> usize +pub fn hex_conservative::prelude::DisplayHex::to_hex_string(self, case: hex_conservative::Case) -> alloc::string::String +pub fn hex_conservative::prelude::DisplayHex::to_lower_hex_string(self) -> alloc::string::String +pub fn hex_conservative::prelude::DisplayHex::to_upper_hex_string(self) -> alloc::string::String +pub hex_conservative::Case::Lower +pub hex_conservative::Case::Upper +pub hex_conservative::DecodeFixedLengthBytesError::InvalidChar(hex_conservative::error::InvalidCharError) +pub hex_conservative::DecodeFixedLengthBytesError::InvalidLength(hex_conservative::error::InvalidLengthError) +pub hex_conservative::DecodeVariableLengthBytesError::InvalidChar(hex_conservative::error::InvalidCharError) +pub hex_conservative::DecodeVariableLengthBytesError::OddLengthString(hex_conservative::error::OddLengthStringError) +pub hex_conservative::error::DecodeFixedLengthBytesError::InvalidChar(hex_conservative::error::InvalidCharError) +pub hex_conservative::error::DecodeFixedLengthBytesError::InvalidLength(hex_conservative::error::InvalidLengthError) +pub hex_conservative::error::DecodeVariableLengthBytesError::InvalidChar(hex_conservative::error::InvalidCharError) +pub hex_conservative::error::DecodeVariableLengthBytesError::OddLengthString(hex_conservative::error::OddLengthStringError) +pub macro hex_conservative::display::fmt_hex_exact! +pub macro hex_conservative::display::impl_fmt_traits! +pub macro hex_conservative::fmt_hex_exact! +pub macro hex_conservative::hex! +pub macro hex_conservative::impl_fmt_traits! +pub mod hex_conservative +pub mod hex_conservative::buf_encoder +pub mod hex_conservative::display +pub mod hex_conservative::error +pub mod hex_conservative::prelude +pub struct hex_conservative::BytesToHexIter where I: core::iter::traits::iterator::Iterator, ::Item: core::borrow::Borrow +pub struct hex_conservative::HexToBytesIter where I: core::iter::traits::iterator::Iterator +pub struct hex_conservative::InvalidCharError +pub struct hex_conservative::InvalidLengthError +pub struct hex_conservative::OddLengthStringError +pub struct hex_conservative::buf_encoder::BufEncoder +pub struct hex_conservative::display::DisplayArray<'a, const CAP: usize> +pub struct hex_conservative::display::DisplayByteSlice<'a> +pub struct hex_conservative::display::HexWriter +pub struct hex_conservative::error::InvalidCharError +pub struct hex_conservative::error::InvalidLengthError +pub struct hex_conservative::error::OddLengthStringError +pub trait hex_conservative::DisplayHex: core::marker::Copy + hex_conservative::display::sealed::IsRef + hex_conservative::display::sealed::Sealed +pub trait hex_conservative::display::DisplayHex: core::marker::Copy + hex_conservative::display::sealed::IsRef + hex_conservative::display::sealed::Sealed +pub trait hex_conservative::prelude::DisplayHex: core::marker::Copy + hex_conservative::display::sealed::IsRef + hex_conservative::display::sealed::Sealed +pub type &'a [u8; 1024]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 10]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 11]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 128]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 12]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 13]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 14]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 15]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 16]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 1]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 2048]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 20]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 256]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 2]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 32]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 33]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 3]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 4096]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 4]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 512]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 5]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 64]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 65]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 6]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 7]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 8]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 9]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8]::Display = hex_conservative::display::DisplayByteSlice<'a> +pub type &'a alloc::vec::Vec::Display = hex_conservative::display::DisplayByteSlice<'a> +pub type hex_conservative::BytesToHexIter::Item = char +pub type hex_conservative::DisplayHex::Display: core::fmt::Display + core::fmt::Debug + core::fmt::LowerHex + core::fmt::UpperHex +pub type hex_conservative::HexSliceToBytesIter<'a> = hex_conservative::HexToBytesIter> +pub type hex_conservative::HexToBytesIter::Item = core::result::Result +pub type hex_conservative::display::DisplayHex::Display: core::fmt::Display + core::fmt::Debug + core::fmt::LowerHex + core::fmt::UpperHex +pub type hex_conservative::prelude::DisplayHex::Display: core::fmt::Display + core::fmt::Debug + core::fmt::LowerHex + core::fmt::UpperHex diff --git a/api/alloc-only.txt b/api/alloc-only.txt new file mode 100644 index 00000000..f6d9ec7a --- /dev/null +++ b/api/alloc-only.txt @@ -0,0 +1,385 @@ +impl core::clone::Clone for hex_conservative::Case +impl core::clone::Clone for hex_conservative::error::DecodeFixedLengthBytesError +impl core::clone::Clone for hex_conservative::error::DecodeVariableLengthBytesError +impl core::clone::Clone for hex_conservative::error::InvalidCharError +impl core::clone::Clone for hex_conservative::error::InvalidLengthError +impl core::clone::Clone for hex_conservative::error::OddLengthStringError +impl core::cmp::Eq for hex_conservative::Case +impl core::cmp::Eq for hex_conservative::error::DecodeFixedLengthBytesError +impl core::cmp::Eq for hex_conservative::error::DecodeVariableLengthBytesError +impl core::cmp::Eq for hex_conservative::error::InvalidCharError +impl core::cmp::Eq for hex_conservative::error::InvalidLengthError +impl core::cmp::Eq for hex_conservative::error::OddLengthStringError +impl core::cmp::PartialEq for hex_conservative::Case +impl core::cmp::PartialEq for hex_conservative::error::DecodeFixedLengthBytesError +impl core::cmp::PartialEq for hex_conservative::error::DecodeVariableLengthBytesError +impl core::cmp::PartialEq for hex_conservative::error::InvalidCharError +impl core::cmp::PartialEq for hex_conservative::error::InvalidLengthError +impl core::cmp::PartialEq for hex_conservative::error::OddLengthStringError +impl core::convert::From for hex_conservative::error::DecodeFixedLengthBytesError +impl core::convert::From for hex_conservative::error::DecodeVariableLengthBytesError +impl core::convert::From for hex_conservative::error::InvalidCharError +impl core::convert::From for hex_conservative::error::InvalidLengthError +impl core::convert::From for hex_conservative::error::OddLengthStringError +impl core::convert::From for hex_conservative::error::DecodeFixedLengthBytesError +impl core::convert::From for hex_conservative::error::DecodeVariableLengthBytesError +impl core::convert::From for hex_conservative::error::DecodeFixedLengthBytesError +impl core::convert::From for hex_conservative::error::DecodeVariableLengthBytesError +impl core::default::Default for hex_conservative::Case +impl core::fmt::Debug for hex_conservative::Case +impl core::fmt::Debug for hex_conservative::display::DisplayByteSlice<'_> +impl core::fmt::Debug for hex_conservative::error::DecodeFixedLengthBytesError +impl core::fmt::Debug for hex_conservative::error::DecodeVariableLengthBytesError +impl core::fmt::Debug for hex_conservative::error::InvalidCharError +impl core::fmt::Debug for hex_conservative::error::InvalidLengthError +impl core::fmt::Debug for hex_conservative::error::OddLengthStringError +impl core::fmt::Display for hex_conservative::display::DisplayByteSlice<'_> +impl core::fmt::Display for hex_conservative::error::DecodeFixedLengthBytesError +impl core::fmt::Display for hex_conservative::error::DecodeVariableLengthBytesError +impl core::fmt::Display for hex_conservative::error::InvalidCharError +impl core::fmt::Display for hex_conservative::error::InvalidLengthError +impl core::fmt::Display for hex_conservative::error::OddLengthStringError +impl core::fmt::LowerHex for hex_conservative::display::DisplayByteSlice<'_> +impl core::fmt::UpperHex for hex_conservative::display::DisplayByteSlice<'_> +impl core::hash::Hash for hex_conservative::Case +impl core::marker::Copy for hex_conservative::Case +impl core::marker::Freeze for hex_conservative::Case +impl core::marker::Freeze for hex_conservative::error::DecodeFixedLengthBytesError +impl core::marker::Freeze for hex_conservative::error::DecodeVariableLengthBytesError +impl core::marker::Freeze for hex_conservative::error::InvalidCharError +impl core::marker::Freeze for hex_conservative::error::InvalidLengthError +impl core::marker::Freeze for hex_conservative::error::OddLengthStringError +impl core::marker::Send for hex_conservative::Case +impl core::marker::Send for hex_conservative::error::DecodeFixedLengthBytesError +impl core::marker::Send for hex_conservative::error::DecodeVariableLengthBytesError +impl core::marker::Send for hex_conservative::error::InvalidCharError +impl core::marker::Send for hex_conservative::error::InvalidLengthError +impl core::marker::Send for hex_conservative::error::OddLengthStringError +impl core::marker::StructuralPartialEq for hex_conservative::Case +impl core::marker::StructuralPartialEq for hex_conservative::error::DecodeFixedLengthBytesError +impl core::marker::StructuralPartialEq for hex_conservative::error::DecodeVariableLengthBytesError +impl core::marker::StructuralPartialEq for hex_conservative::error::InvalidCharError +impl core::marker::StructuralPartialEq for hex_conservative::error::InvalidLengthError +impl core::marker::StructuralPartialEq for hex_conservative::error::OddLengthStringError +impl core::marker::Sync for hex_conservative::Case +impl core::marker::Sync for hex_conservative::error::DecodeFixedLengthBytesError +impl core::marker::Sync for hex_conservative::error::DecodeVariableLengthBytesError +impl core::marker::Sync for hex_conservative::error::InvalidCharError +impl core::marker::Sync for hex_conservative::error::InvalidLengthError +impl core::marker::Sync for hex_conservative::error::OddLengthStringError +impl core::marker::Unpin for hex_conservative::Case +impl core::marker::Unpin for hex_conservative::error::DecodeFixedLengthBytesError +impl core::marker::Unpin for hex_conservative::error::DecodeVariableLengthBytesError +impl core::marker::Unpin for hex_conservative::error::InvalidCharError +impl core::marker::Unpin for hex_conservative::error::InvalidLengthError +impl core::marker::Unpin for hex_conservative::error::OddLengthStringError +impl core::panic::unwind_safe::RefUnwindSafe for hex_conservative::Case +impl core::panic::unwind_safe::RefUnwindSafe for hex_conservative::error::DecodeFixedLengthBytesError +impl core::panic::unwind_safe::RefUnwindSafe for hex_conservative::error::DecodeVariableLengthBytesError +impl core::panic::unwind_safe::RefUnwindSafe for hex_conservative::error::InvalidCharError +impl core::panic::unwind_safe::RefUnwindSafe for hex_conservative::error::InvalidLengthError +impl core::panic::unwind_safe::RefUnwindSafe for hex_conservative::error::OddLengthStringError +impl core::panic::unwind_safe::UnwindSafe for hex_conservative::Case +impl core::panic::unwind_safe::UnwindSafe for hex_conservative::error::DecodeFixedLengthBytesError +impl core::panic::unwind_safe::UnwindSafe for hex_conservative::error::DecodeVariableLengthBytesError +impl core::panic::unwind_safe::UnwindSafe for hex_conservative::error::InvalidCharError +impl core::panic::unwind_safe::UnwindSafe for hex_conservative::error::InvalidLengthError +impl core::panic::unwind_safe::UnwindSafe for hex_conservative::error::OddLengthStringError +impl hex_conservative::error::DecodeFixedLengthBytesError +impl hex_conservative::error::DecodeVariableLengthBytesError +impl hex_conservative::error::InvalidCharError +impl hex_conservative::error::InvalidLengthError +impl hex_conservative::error::OddLengthStringError +impl<'a, const CAP: usize> core::marker::Freeze for hex_conservative::display::DisplayArray<'a, CAP> +impl<'a, const CAP: usize> core::marker::Send for hex_conservative::display::DisplayArray<'a, CAP> +impl<'a, const CAP: usize> core::marker::Sync for hex_conservative::display::DisplayArray<'a, CAP> +impl<'a, const CAP: usize> core::marker::Unpin for hex_conservative::display::DisplayArray<'a, CAP> +impl<'a, const CAP: usize> core::panic::unwind_safe::RefUnwindSafe for hex_conservative::display::DisplayArray<'a, CAP> +impl<'a, const CAP: usize> core::panic::unwind_safe::UnwindSafe for hex_conservative::display::DisplayArray<'a, CAP> +impl<'a> core::marker::Freeze for hex_conservative::display::DisplayByteSlice<'a> +impl<'a> core::marker::Send for hex_conservative::display::DisplayByteSlice<'a> +impl<'a> core::marker::Sync for hex_conservative::display::DisplayByteSlice<'a> +impl<'a> core::marker::Unpin for hex_conservative::display::DisplayByteSlice<'a> +impl<'a> core::panic::unwind_safe::RefUnwindSafe for hex_conservative::display::DisplayByteSlice<'a> +impl<'a> core::panic::unwind_safe::UnwindSafe for hex_conservative::display::DisplayByteSlice<'a> +impl<'a> hex_conservative::HexToBytesIter> +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 1024] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 10] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 11] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 128] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 12] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 13] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 14] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 15] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 16] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 1] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 2048] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 20] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 256] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 2] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 32] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 33] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 3] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 4096] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 4] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 512] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 5] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 64] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 65] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 6] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 7] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 8] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 9] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8] +impl<'a> hex_conservative::display::DisplayHex for &'a alloc::vec::Vec +impl core::fmt::Debug for hex_conservative::BytesToHexIter where I: core::iter::traits::iterator::Iterator + core::fmt::Debug, ::Item: core::borrow::Borrow +impl core::fmt::Debug for hex_conservative::HexToBytesIter where I: core::iter::traits::iterator::Iterator + core::fmt::Debug +impl core::iter::traits::double_ended::DoubleEndedIterator for hex_conservative::BytesToHexIter where I: core::iter::traits::double_ended::DoubleEndedIterator, ::Item: core::borrow::Borrow +impl core::iter::traits::double_ended::DoubleEndedIterator for hex_conservative::HexToBytesIter where I: core::iter::traits::iterator::Iterator + core::iter::traits::double_ended::DoubleEndedIterator + core::iter::traits::exact_size::ExactSizeIterator +impl core::iter::traits::exact_size::ExactSizeIterator for hex_conservative::BytesToHexIter where I: core::iter::traits::exact_size::ExactSizeIterator, ::Item: core::borrow::Borrow +impl core::iter::traits::exact_size::ExactSizeIterator for hex_conservative::HexToBytesIter where I: core::iter::traits::iterator::Iterator + core::iter::traits::exact_size::ExactSizeIterator +impl core::iter::traits::iterator::Iterator for hex_conservative::BytesToHexIter where I: core::iter::traits::iterator::Iterator, ::Item: core::borrow::Borrow +impl core::iter::traits::iterator::Iterator for hex_conservative::HexToBytesIter where I: core::iter::traits::iterator::Iterator + core::iter::traits::exact_size::ExactSizeIterator +impl core::iter::traits::marker::FusedIterator for hex_conservative::BytesToHexIter where I: core::iter::traits::marker::FusedIterator, ::Item: core::borrow::Borrow +impl core::iter::traits::marker::FusedIterator for hex_conservative::HexToBytesIter where I: core::iter::traits::iterator::Iterator + core::iter::traits::exact_size::ExactSizeIterator + core::iter::traits::marker::FusedIterator +impl core::marker::Freeze for hex_conservative::BytesToHexIter where I: core::marker::Freeze +impl core::marker::Freeze for hex_conservative::HexToBytesIter where I: core::marker::Freeze +impl core::marker::Send for hex_conservative::BytesToHexIter where I: core::marker::Send +impl core::marker::Send for hex_conservative::HexToBytesIter where I: core::marker::Send +impl core::marker::Sync for hex_conservative::BytesToHexIter where I: core::marker::Sync +impl core::marker::Sync for hex_conservative::HexToBytesIter where I: core::marker::Sync +impl core::marker::Unpin for hex_conservative::BytesToHexIter where I: core::marker::Unpin +impl core::marker::Unpin for hex_conservative::HexToBytesIter where I: core::marker::Unpin +impl core::panic::unwind_safe::RefUnwindSafe for hex_conservative::BytesToHexIter where I: core::panic::unwind_safe::RefUnwindSafe +impl core::panic::unwind_safe::RefUnwindSafe for hex_conservative::HexToBytesIter where I: core::panic::unwind_safe::RefUnwindSafe +impl core::panic::unwind_safe::UnwindSafe for hex_conservative::BytesToHexIter where I: core::panic::unwind_safe::UnwindSafe +impl core::panic::unwind_safe::UnwindSafe for hex_conservative::HexToBytesIter where I: core::panic::unwind_safe::UnwindSafe +impl hex_conservative::BytesToHexIter where I: core::iter::traits::iterator::Iterator, ::Item: core::borrow::Borrow +impl hex_conservative::HexToBytesIter where I: core::iter::traits::iterator::Iterator + core::iter::traits::exact_size::ExactSizeIterator +impl core::default::Default for hex_conservative::buf_encoder::BufEncoder +impl core::fmt::Debug for hex_conservative::buf_encoder::BufEncoder +impl core::marker::Freeze for hex_conservative::buf_encoder::BufEncoder +impl core::marker::Send for hex_conservative::buf_encoder::BufEncoder +impl core::marker::Sync for hex_conservative::buf_encoder::BufEncoder +impl core::marker::Unpin for hex_conservative::buf_encoder::BufEncoder +impl core::panic::unwind_safe::RefUnwindSafe for hex_conservative::buf_encoder::BufEncoder +impl core::panic::unwind_safe::UnwindSafe for hex_conservative::buf_encoder::BufEncoder +impl hex_conservative::buf_encoder::BufEncoder +impl core::fmt::Debug for hex_conservative::display::DisplayArray<'_, LEN> +impl core::fmt::Display for hex_conservative::display::DisplayArray<'_, LEN> +impl core::fmt::LowerHex for hex_conservative::display::DisplayArray<'_, LEN> +impl core::fmt::UpperHex for hex_conservative::display::DisplayArray<'_, LEN> +pub enum hex_conservative::Case +pub enum hex_conservative::DecodeFixedLengthBytesError +pub enum hex_conservative::DecodeVariableLengthBytesError +pub enum hex_conservative::error::DecodeFixedLengthBytesError +pub enum hex_conservative::error::DecodeVariableLengthBytesError +pub fn &'a [u8; 1024]::as_hex(self) -> Self::Display +pub fn &'a [u8; 1024]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 10]::as_hex(self) -> Self::Display +pub fn &'a [u8; 10]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 11]::as_hex(self) -> Self::Display +pub fn &'a [u8; 11]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 128]::as_hex(self) -> Self::Display +pub fn &'a [u8; 128]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 12]::as_hex(self) -> Self::Display +pub fn &'a [u8; 12]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 13]::as_hex(self) -> Self::Display +pub fn &'a [u8; 13]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 14]::as_hex(self) -> Self::Display +pub fn &'a [u8; 14]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 15]::as_hex(self) -> Self::Display +pub fn &'a [u8; 15]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 16]::as_hex(self) -> Self::Display +pub fn &'a [u8; 16]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 1]::as_hex(self) -> Self::Display +pub fn &'a [u8; 1]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 2048]::as_hex(self) -> Self::Display +pub fn &'a [u8; 2048]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 20]::as_hex(self) -> Self::Display +pub fn &'a [u8; 20]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 256]::as_hex(self) -> Self::Display +pub fn &'a [u8; 256]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 2]::as_hex(self) -> Self::Display +pub fn &'a [u8; 2]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 32]::as_hex(self) -> Self::Display +pub fn &'a [u8; 32]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 33]::as_hex(self) -> Self::Display +pub fn &'a [u8; 33]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 3]::as_hex(self) -> Self::Display +pub fn &'a [u8; 3]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 4096]::as_hex(self) -> Self::Display +pub fn &'a [u8; 4096]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 4]::as_hex(self) -> Self::Display +pub fn &'a [u8; 4]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 512]::as_hex(self) -> Self::Display +pub fn &'a [u8; 512]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 5]::as_hex(self) -> Self::Display +pub fn &'a [u8; 5]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 64]::as_hex(self) -> Self::Display +pub fn &'a [u8; 64]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 65]::as_hex(self) -> Self::Display +pub fn &'a [u8; 65]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 6]::as_hex(self) -> Self::Display +pub fn &'a [u8; 6]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 7]::as_hex(self) -> Self::Display +pub fn &'a [u8; 7]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 8]::as_hex(self) -> Self::Display +pub fn &'a [u8; 8]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 9]::as_hex(self) -> Self::Display +pub fn &'a [u8; 9]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8]::as_hex(self) -> Self::Display +pub fn &'a [u8]::hex_reserve_suggestion(self) -> usize +pub fn &'a alloc::vec::Vec::as_hex(self) -> Self::Display +pub fn &'a alloc::vec::Vec::hex_reserve_suggestion(self) -> usize +pub fn hex_conservative::BytesToHexIter::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::BytesToHexIter::len(&self) -> usize +pub fn hex_conservative::BytesToHexIter::new(iter: I, case: hex_conservative::Case) -> hex_conservative::BytesToHexIter +pub fn hex_conservative::BytesToHexIter::next(&mut self) -> core::option::Option +pub fn hex_conservative::BytesToHexIter::next_back(&mut self) -> core::option::Option +pub fn hex_conservative::BytesToHexIter::size_hint(&self) -> (usize, core::option::Option) +pub fn hex_conservative::Case::clone(&self) -> hex_conservative::Case +pub fn hex_conservative::Case::default() -> Self +pub fn hex_conservative::Case::eq(&self, other: &hex_conservative::Case) -> bool +pub fn hex_conservative::Case::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::Case::hash<__H: core::hash::Hasher>(&self, state: &mut __H) +pub fn hex_conservative::DisplayHex::append_hex_to_string(self, case: hex_conservative::Case, string: &mut alloc::string::String) +pub fn hex_conservative::DisplayHex::as_hex(self) -> Self::Display +pub fn hex_conservative::DisplayHex::hex_reserve_suggestion(self) -> usize +pub fn hex_conservative::DisplayHex::to_hex_string(self, case: hex_conservative::Case) -> alloc::string::String +pub fn hex_conservative::DisplayHex::to_lower_hex_string(self) -> alloc::string::String +pub fn hex_conservative::DisplayHex::to_upper_hex_string(self) -> alloc::string::String +pub fn hex_conservative::HexToBytesIter::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::HexToBytesIter::from_pairs(iter: I) -> Self +pub fn hex_conservative::HexToBytesIter::next(&mut self) -> core::option::Option +pub fn hex_conservative::HexToBytesIter::next_back(&mut self) -> core::option::Option +pub fn hex_conservative::HexToBytesIter::nth(&mut self, n: usize) -> core::option::Option +pub fn hex_conservative::HexToBytesIter::nth_back(&mut self, n: usize) -> core::option::Option +pub fn hex_conservative::HexToBytesIter::size_hint(&self) -> (usize, core::option::Option) +pub fn hex_conservative::HexToBytesIter>::new(s: &'a str) -> core::result::Result +pub fn hex_conservative::buf_encoder::BufEncoder::as_str(&self) -> &str +pub fn hex_conservative::buf_encoder::BufEncoder::clear(&mut self) +pub fn hex_conservative::buf_encoder::BufEncoder::default() -> Self +pub fn hex_conservative::buf_encoder::BufEncoder::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::buf_encoder::BufEncoder::is_full(&self) -> bool +pub fn hex_conservative::buf_encoder::BufEncoder::new(case: hex_conservative::Case) -> Self +pub fn hex_conservative::buf_encoder::BufEncoder::put_byte(&mut self, byte: u8) +pub fn hex_conservative::buf_encoder::BufEncoder::put_bytes(&mut self, bytes: I) where I: core::iter::traits::collect::IntoIterator, ::Item: core::borrow::Borrow +pub fn hex_conservative::buf_encoder::BufEncoder::put_bytes_min<'a>(&mut self, bytes: &'a [u8]) -> &'a [u8] +pub fn hex_conservative::buf_encoder::BufEncoder::space_remaining(&self) -> usize +pub fn hex_conservative::decode_to_array(hex: &str) -> core::result::Result<[u8; N], hex_conservative::error::DecodeFixedLengthBytesError> +pub fn hex_conservative::decode_to_vec(hex: &str) -> core::result::Result, hex_conservative::error::DecodeVariableLengthBytesError> +pub fn hex_conservative::display::DisplayArray<'_, LEN>::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::display::DisplayByteSlice<'_>::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::display::DisplayHex::append_hex_to_string(self, case: hex_conservative::Case, string: &mut alloc::string::String) +pub fn hex_conservative::display::DisplayHex::as_hex(self) -> Self::Display +pub fn hex_conservative::display::DisplayHex::hex_reserve_suggestion(self) -> usize +pub fn hex_conservative::display::DisplayHex::to_hex_string(self, case: hex_conservative::Case) -> alloc::string::String +pub fn hex_conservative::display::DisplayHex::to_lower_hex_string(self) -> alloc::string::String +pub fn hex_conservative::display::DisplayHex::to_upper_hex_string(self) -> alloc::string::String +pub fn hex_conservative::error::DecodeFixedLengthBytesError::clone(&self) -> hex_conservative::error::DecodeFixedLengthBytesError +pub fn hex_conservative::error::DecodeFixedLengthBytesError::eq(&self, other: &hex_conservative::error::DecodeFixedLengthBytesError) -> bool +pub fn hex_conservative::error::DecodeFixedLengthBytesError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::error::DecodeFixedLengthBytesError::from(e: hex_conservative::error::InvalidCharError) -> Self +pub fn hex_conservative::error::DecodeFixedLengthBytesError::from(e: hex_conservative::error::InvalidLengthError) -> Self +pub fn hex_conservative::error::DecodeFixedLengthBytesError::from(never: core::convert::Infallible) -> Self +pub fn hex_conservative::error::DecodeFixedLengthBytesError::offset(self, by_bytes: usize) -> Self +pub fn hex_conservative::error::DecodeVariableLengthBytesError::clone(&self) -> hex_conservative::error::DecodeVariableLengthBytesError +pub fn hex_conservative::error::DecodeVariableLengthBytesError::eq(&self, other: &hex_conservative::error::DecodeVariableLengthBytesError) -> bool +pub fn hex_conservative::error::DecodeVariableLengthBytesError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::error::DecodeVariableLengthBytesError::from(e: hex_conservative::error::InvalidCharError) -> Self +pub fn hex_conservative::error::DecodeVariableLengthBytesError::from(e: hex_conservative::error::OddLengthStringError) -> Self +pub fn hex_conservative::error::DecodeVariableLengthBytesError::from(never: core::convert::Infallible) -> Self +pub fn hex_conservative::error::DecodeVariableLengthBytesError::offset(self, by_bytes: usize) -> Self +pub fn hex_conservative::error::InvalidCharError::clone(&self) -> hex_conservative::error::InvalidCharError +pub fn hex_conservative::error::InvalidCharError::eq(&self, other: &hex_conservative::error::InvalidCharError) -> bool +pub fn hex_conservative::error::InvalidCharError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::error::InvalidCharError::from(never: core::convert::Infallible) -> Self +pub fn hex_conservative::error::InvalidCharError::offset(self, by_bytes: usize) -> Self +pub fn hex_conservative::error::InvalidCharError::pos(&self) -> usize +pub fn hex_conservative::error::InvalidLengthError::clone(&self) -> hex_conservative::error::InvalidLengthError +pub fn hex_conservative::error::InvalidLengthError::eq(&self, other: &hex_conservative::error::InvalidLengthError) -> bool +pub fn hex_conservative::error::InvalidLengthError::expected_length(&self) -> usize +pub fn hex_conservative::error::InvalidLengthError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::error::InvalidLengthError::from(never: core::convert::Infallible) -> Self +pub fn hex_conservative::error::InvalidLengthError::invalid_length(&self) -> usize +pub fn hex_conservative::error::OddLengthStringError::clone(&self) -> hex_conservative::error::OddLengthStringError +pub fn hex_conservative::error::OddLengthStringError::eq(&self, other: &hex_conservative::error::OddLengthStringError) -> bool +pub fn hex_conservative::error::OddLengthStringError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::error::OddLengthStringError::from(never: core::convert::Infallible) -> Self +pub fn hex_conservative::error::OddLengthStringError::length(&self) -> usize +pub fn hex_conservative::prelude::DisplayHex::append_hex_to_string(self, case: hex_conservative::Case, string: &mut alloc::string::String) +pub fn hex_conservative::prelude::DisplayHex::as_hex(self) -> Self::Display +pub fn hex_conservative::prelude::DisplayHex::hex_reserve_suggestion(self) -> usize +pub fn hex_conservative::prelude::DisplayHex::to_hex_string(self, case: hex_conservative::Case) -> alloc::string::String +pub fn hex_conservative::prelude::DisplayHex::to_lower_hex_string(self) -> alloc::string::String +pub fn hex_conservative::prelude::DisplayHex::to_upper_hex_string(self) -> alloc::string::String +pub hex_conservative::Case::Lower +pub hex_conservative::Case::Upper +pub hex_conservative::DecodeFixedLengthBytesError::InvalidChar(hex_conservative::error::InvalidCharError) +pub hex_conservative::DecodeFixedLengthBytesError::InvalidLength(hex_conservative::error::InvalidLengthError) +pub hex_conservative::DecodeVariableLengthBytesError::InvalidChar(hex_conservative::error::InvalidCharError) +pub hex_conservative::DecodeVariableLengthBytesError::OddLengthString(hex_conservative::error::OddLengthStringError) +pub hex_conservative::error::DecodeFixedLengthBytesError::InvalidChar(hex_conservative::error::InvalidCharError) +pub hex_conservative::error::DecodeFixedLengthBytesError::InvalidLength(hex_conservative::error::InvalidLengthError) +pub hex_conservative::error::DecodeVariableLengthBytesError::InvalidChar(hex_conservative::error::InvalidCharError) +pub hex_conservative::error::DecodeVariableLengthBytesError::OddLengthString(hex_conservative::error::OddLengthStringError) +pub macro hex_conservative::display::fmt_hex_exact! +pub macro hex_conservative::display::impl_fmt_traits! +pub macro hex_conservative::fmt_hex_exact! +pub macro hex_conservative::hex! +pub macro hex_conservative::impl_fmt_traits! +pub mod hex_conservative +pub mod hex_conservative::buf_encoder +pub mod hex_conservative::display +pub mod hex_conservative::error +pub mod hex_conservative::prelude +pub struct hex_conservative::BytesToHexIter where I: core::iter::traits::iterator::Iterator, ::Item: core::borrow::Borrow +pub struct hex_conservative::HexToBytesIter where I: core::iter::traits::iterator::Iterator +pub struct hex_conservative::InvalidCharError +pub struct hex_conservative::InvalidLengthError +pub struct hex_conservative::OddLengthStringError +pub struct hex_conservative::buf_encoder::BufEncoder +pub struct hex_conservative::display::DisplayArray<'a, const CAP: usize> +pub struct hex_conservative::display::DisplayByteSlice<'a> +pub struct hex_conservative::error::InvalidCharError +pub struct hex_conservative::error::InvalidLengthError +pub struct hex_conservative::error::OddLengthStringError +pub trait hex_conservative::DisplayHex: core::marker::Copy + hex_conservative::display::sealed::IsRef + hex_conservative::display::sealed::Sealed +pub trait hex_conservative::display::DisplayHex: core::marker::Copy + hex_conservative::display::sealed::IsRef + hex_conservative::display::sealed::Sealed +pub trait hex_conservative::prelude::DisplayHex: core::marker::Copy + hex_conservative::display::sealed::IsRef + hex_conservative::display::sealed::Sealed +pub type &'a [u8; 1024]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 10]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 11]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 128]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 12]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 13]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 14]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 15]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 16]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 1]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 2048]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 20]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 256]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 2]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 32]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 33]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 3]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 4096]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 4]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 512]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 5]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 64]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 65]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 6]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 7]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 8]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 9]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8]::Display = hex_conservative::display::DisplayByteSlice<'a> +pub type &'a alloc::vec::Vec::Display = hex_conservative::display::DisplayByteSlice<'a> +pub type hex_conservative::BytesToHexIter::Item = char +pub type hex_conservative::DisplayHex::Display: core::fmt::Display + core::fmt::Debug + core::fmt::LowerHex + core::fmt::UpperHex +pub type hex_conservative::HexSliceToBytesIter<'a> = hex_conservative::HexToBytesIter> +pub type hex_conservative::HexToBytesIter::Item = core::result::Result +pub type hex_conservative::display::DisplayHex::Display: core::fmt::Display + core::fmt::Debug + core::fmt::LowerHex + core::fmt::UpperHex +pub type hex_conservative::prelude::DisplayHex::Display: core::fmt::Display + core::fmt::Debug + core::fmt::LowerHex + core::fmt::UpperHex diff --git a/api/no-features.txt b/api/no-features.txt new file mode 100644 index 00000000..cd001e65 --- /dev/null +++ b/api/no-features.txt @@ -0,0 +1,368 @@ +impl core::clone::Clone for hex_conservative::Case +impl core::clone::Clone for hex_conservative::error::DecodeFixedLengthBytesError +impl core::clone::Clone for hex_conservative::error::DecodeVariableLengthBytesError +impl core::clone::Clone for hex_conservative::error::InvalidCharError +impl core::clone::Clone for hex_conservative::error::InvalidLengthError +impl core::clone::Clone for hex_conservative::error::OddLengthStringError +impl core::cmp::Eq for hex_conservative::Case +impl core::cmp::Eq for hex_conservative::error::DecodeFixedLengthBytesError +impl core::cmp::Eq for hex_conservative::error::DecodeVariableLengthBytesError +impl core::cmp::Eq for hex_conservative::error::InvalidCharError +impl core::cmp::Eq for hex_conservative::error::InvalidLengthError +impl core::cmp::Eq for hex_conservative::error::OddLengthStringError +impl core::cmp::PartialEq for hex_conservative::Case +impl core::cmp::PartialEq for hex_conservative::error::DecodeFixedLengthBytesError +impl core::cmp::PartialEq for hex_conservative::error::DecodeVariableLengthBytesError +impl core::cmp::PartialEq for hex_conservative::error::InvalidCharError +impl core::cmp::PartialEq for hex_conservative::error::InvalidLengthError +impl core::cmp::PartialEq for hex_conservative::error::OddLengthStringError +impl core::convert::From for hex_conservative::error::DecodeFixedLengthBytesError +impl core::convert::From for hex_conservative::error::DecodeVariableLengthBytesError +impl core::convert::From for hex_conservative::error::InvalidCharError +impl core::convert::From for hex_conservative::error::InvalidLengthError +impl core::convert::From for hex_conservative::error::OddLengthStringError +impl core::convert::From for hex_conservative::error::DecodeFixedLengthBytesError +impl core::convert::From for hex_conservative::error::DecodeVariableLengthBytesError +impl core::convert::From for hex_conservative::error::DecodeFixedLengthBytesError +impl core::convert::From for hex_conservative::error::DecodeVariableLengthBytesError +impl core::default::Default for hex_conservative::Case +impl core::fmt::Debug for hex_conservative::Case +impl core::fmt::Debug for hex_conservative::display::DisplayByteSlice<'_> +impl core::fmt::Debug for hex_conservative::error::DecodeFixedLengthBytesError +impl core::fmt::Debug for hex_conservative::error::DecodeVariableLengthBytesError +impl core::fmt::Debug for hex_conservative::error::InvalidCharError +impl core::fmt::Debug for hex_conservative::error::InvalidLengthError +impl core::fmt::Debug for hex_conservative::error::OddLengthStringError +impl core::fmt::Display for hex_conservative::display::DisplayByteSlice<'_> +impl core::fmt::Display for hex_conservative::error::DecodeFixedLengthBytesError +impl core::fmt::Display for hex_conservative::error::DecodeVariableLengthBytesError +impl core::fmt::Display for hex_conservative::error::InvalidCharError +impl core::fmt::Display for hex_conservative::error::InvalidLengthError +impl core::fmt::Display for hex_conservative::error::OddLengthStringError +impl core::fmt::LowerHex for hex_conservative::display::DisplayByteSlice<'_> +impl core::fmt::UpperHex for hex_conservative::display::DisplayByteSlice<'_> +impl core::hash::Hash for hex_conservative::Case +impl core::marker::Copy for hex_conservative::Case +impl core::marker::Freeze for hex_conservative::Case +impl core::marker::Freeze for hex_conservative::error::DecodeFixedLengthBytesError +impl core::marker::Freeze for hex_conservative::error::DecodeVariableLengthBytesError +impl core::marker::Freeze for hex_conservative::error::InvalidCharError +impl core::marker::Freeze for hex_conservative::error::InvalidLengthError +impl core::marker::Freeze for hex_conservative::error::OddLengthStringError +impl core::marker::Send for hex_conservative::Case +impl core::marker::Send for hex_conservative::error::DecodeFixedLengthBytesError +impl core::marker::Send for hex_conservative::error::DecodeVariableLengthBytesError +impl core::marker::Send for hex_conservative::error::InvalidCharError +impl core::marker::Send for hex_conservative::error::InvalidLengthError +impl core::marker::Send for hex_conservative::error::OddLengthStringError +impl core::marker::StructuralPartialEq for hex_conservative::Case +impl core::marker::StructuralPartialEq for hex_conservative::error::DecodeFixedLengthBytesError +impl core::marker::StructuralPartialEq for hex_conservative::error::DecodeVariableLengthBytesError +impl core::marker::StructuralPartialEq for hex_conservative::error::InvalidCharError +impl core::marker::StructuralPartialEq for hex_conservative::error::InvalidLengthError +impl core::marker::StructuralPartialEq for hex_conservative::error::OddLengthStringError +impl core::marker::Sync for hex_conservative::Case +impl core::marker::Sync for hex_conservative::error::DecodeFixedLengthBytesError +impl core::marker::Sync for hex_conservative::error::DecodeVariableLengthBytesError +impl core::marker::Sync for hex_conservative::error::InvalidCharError +impl core::marker::Sync for hex_conservative::error::InvalidLengthError +impl core::marker::Sync for hex_conservative::error::OddLengthStringError +impl core::marker::Unpin for hex_conservative::Case +impl core::marker::Unpin for hex_conservative::error::DecodeFixedLengthBytesError +impl core::marker::Unpin for hex_conservative::error::DecodeVariableLengthBytesError +impl core::marker::Unpin for hex_conservative::error::InvalidCharError +impl core::marker::Unpin for hex_conservative::error::InvalidLengthError +impl core::marker::Unpin for hex_conservative::error::OddLengthStringError +impl core::panic::unwind_safe::RefUnwindSafe for hex_conservative::Case +impl core::panic::unwind_safe::RefUnwindSafe for hex_conservative::error::DecodeFixedLengthBytesError +impl core::panic::unwind_safe::RefUnwindSafe for hex_conservative::error::DecodeVariableLengthBytesError +impl core::panic::unwind_safe::RefUnwindSafe for hex_conservative::error::InvalidCharError +impl core::panic::unwind_safe::RefUnwindSafe for hex_conservative::error::InvalidLengthError +impl core::panic::unwind_safe::RefUnwindSafe for hex_conservative::error::OddLengthStringError +impl core::panic::unwind_safe::UnwindSafe for hex_conservative::Case +impl core::panic::unwind_safe::UnwindSafe for hex_conservative::error::DecodeFixedLengthBytesError +impl core::panic::unwind_safe::UnwindSafe for hex_conservative::error::DecodeVariableLengthBytesError +impl core::panic::unwind_safe::UnwindSafe for hex_conservative::error::InvalidCharError +impl core::panic::unwind_safe::UnwindSafe for hex_conservative::error::InvalidLengthError +impl core::panic::unwind_safe::UnwindSafe for hex_conservative::error::OddLengthStringError +impl hex_conservative::error::DecodeFixedLengthBytesError +impl hex_conservative::error::DecodeVariableLengthBytesError +impl hex_conservative::error::InvalidCharError +impl hex_conservative::error::InvalidLengthError +impl hex_conservative::error::OddLengthStringError +impl<'a, const CAP: usize> core::marker::Freeze for hex_conservative::display::DisplayArray<'a, CAP> +impl<'a, const CAP: usize> core::marker::Send for hex_conservative::display::DisplayArray<'a, CAP> +impl<'a, const CAP: usize> core::marker::Sync for hex_conservative::display::DisplayArray<'a, CAP> +impl<'a, const CAP: usize> core::marker::Unpin for hex_conservative::display::DisplayArray<'a, CAP> +impl<'a, const CAP: usize> core::panic::unwind_safe::RefUnwindSafe for hex_conservative::display::DisplayArray<'a, CAP> +impl<'a, const CAP: usize> core::panic::unwind_safe::UnwindSafe for hex_conservative::display::DisplayArray<'a, CAP> +impl<'a> core::marker::Freeze for hex_conservative::display::DisplayByteSlice<'a> +impl<'a> core::marker::Send for hex_conservative::display::DisplayByteSlice<'a> +impl<'a> core::marker::Sync for hex_conservative::display::DisplayByteSlice<'a> +impl<'a> core::marker::Unpin for hex_conservative::display::DisplayByteSlice<'a> +impl<'a> core::panic::unwind_safe::RefUnwindSafe for hex_conservative::display::DisplayByteSlice<'a> +impl<'a> core::panic::unwind_safe::UnwindSafe for hex_conservative::display::DisplayByteSlice<'a> +impl<'a> hex_conservative::HexToBytesIter> +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 1024] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 10] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 11] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 128] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 12] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 13] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 14] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 15] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 16] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 1] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 2048] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 20] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 256] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 2] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 32] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 33] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 3] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 4096] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 4] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 512] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 5] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 64] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 65] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 6] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 7] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 8] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8; 9] +impl<'a> hex_conservative::display::DisplayHex for &'a [u8] +impl core::fmt::Debug for hex_conservative::BytesToHexIter where I: core::iter::traits::iterator::Iterator + core::fmt::Debug, ::Item: core::borrow::Borrow +impl core::fmt::Debug for hex_conservative::HexToBytesIter where I: core::iter::traits::iterator::Iterator + core::fmt::Debug +impl core::iter::traits::double_ended::DoubleEndedIterator for hex_conservative::BytesToHexIter where I: core::iter::traits::double_ended::DoubleEndedIterator, ::Item: core::borrow::Borrow +impl core::iter::traits::double_ended::DoubleEndedIterator for hex_conservative::HexToBytesIter where I: core::iter::traits::iterator::Iterator + core::iter::traits::double_ended::DoubleEndedIterator + core::iter::traits::exact_size::ExactSizeIterator +impl core::iter::traits::exact_size::ExactSizeIterator for hex_conservative::BytesToHexIter where I: core::iter::traits::exact_size::ExactSizeIterator, ::Item: core::borrow::Borrow +impl core::iter::traits::exact_size::ExactSizeIterator for hex_conservative::HexToBytesIter where I: core::iter::traits::iterator::Iterator + core::iter::traits::exact_size::ExactSizeIterator +impl core::iter::traits::iterator::Iterator for hex_conservative::BytesToHexIter where I: core::iter::traits::iterator::Iterator, ::Item: core::borrow::Borrow +impl core::iter::traits::iterator::Iterator for hex_conservative::HexToBytesIter where I: core::iter::traits::iterator::Iterator + core::iter::traits::exact_size::ExactSizeIterator +impl core::iter::traits::marker::FusedIterator for hex_conservative::BytesToHexIter where I: core::iter::traits::marker::FusedIterator, ::Item: core::borrow::Borrow +impl core::iter::traits::marker::FusedIterator for hex_conservative::HexToBytesIter where I: core::iter::traits::iterator::Iterator + core::iter::traits::exact_size::ExactSizeIterator + core::iter::traits::marker::FusedIterator +impl core::marker::Freeze for hex_conservative::BytesToHexIter where I: core::marker::Freeze +impl core::marker::Freeze for hex_conservative::HexToBytesIter where I: core::marker::Freeze +impl core::marker::Send for hex_conservative::BytesToHexIter where I: core::marker::Send +impl core::marker::Send for hex_conservative::HexToBytesIter where I: core::marker::Send +impl core::marker::Sync for hex_conservative::BytesToHexIter where I: core::marker::Sync +impl core::marker::Sync for hex_conservative::HexToBytesIter where I: core::marker::Sync +impl core::marker::Unpin for hex_conservative::BytesToHexIter where I: core::marker::Unpin +impl core::marker::Unpin for hex_conservative::HexToBytesIter where I: core::marker::Unpin +impl core::panic::unwind_safe::RefUnwindSafe for hex_conservative::BytesToHexIter where I: core::panic::unwind_safe::RefUnwindSafe +impl core::panic::unwind_safe::RefUnwindSafe for hex_conservative::HexToBytesIter where I: core::panic::unwind_safe::RefUnwindSafe +impl core::panic::unwind_safe::UnwindSafe for hex_conservative::BytesToHexIter where I: core::panic::unwind_safe::UnwindSafe +impl core::panic::unwind_safe::UnwindSafe for hex_conservative::HexToBytesIter where I: core::panic::unwind_safe::UnwindSafe +impl hex_conservative::BytesToHexIter where I: core::iter::traits::iterator::Iterator, ::Item: core::borrow::Borrow +impl hex_conservative::HexToBytesIter where I: core::iter::traits::iterator::Iterator + core::iter::traits::exact_size::ExactSizeIterator +impl core::default::Default for hex_conservative::buf_encoder::BufEncoder +impl core::fmt::Debug for hex_conservative::buf_encoder::BufEncoder +impl core::marker::Freeze for hex_conservative::buf_encoder::BufEncoder +impl core::marker::Send for hex_conservative::buf_encoder::BufEncoder +impl core::marker::Sync for hex_conservative::buf_encoder::BufEncoder +impl core::marker::Unpin for hex_conservative::buf_encoder::BufEncoder +impl core::panic::unwind_safe::RefUnwindSafe for hex_conservative::buf_encoder::BufEncoder +impl core::panic::unwind_safe::UnwindSafe for hex_conservative::buf_encoder::BufEncoder +impl hex_conservative::buf_encoder::BufEncoder +impl core::fmt::Debug for hex_conservative::display::DisplayArray<'_, LEN> +impl core::fmt::Display for hex_conservative::display::DisplayArray<'_, LEN> +impl core::fmt::LowerHex for hex_conservative::display::DisplayArray<'_, LEN> +impl core::fmt::UpperHex for hex_conservative::display::DisplayArray<'_, LEN> +pub enum hex_conservative::Case +pub enum hex_conservative::DecodeFixedLengthBytesError +pub enum hex_conservative::DecodeVariableLengthBytesError +pub enum hex_conservative::error::DecodeFixedLengthBytesError +pub enum hex_conservative::error::DecodeVariableLengthBytesError +pub fn &'a [u8; 1024]::as_hex(self) -> Self::Display +pub fn &'a [u8; 1024]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 10]::as_hex(self) -> Self::Display +pub fn &'a [u8; 10]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 11]::as_hex(self) -> Self::Display +pub fn &'a [u8; 11]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 128]::as_hex(self) -> Self::Display +pub fn &'a [u8; 128]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 12]::as_hex(self) -> Self::Display +pub fn &'a [u8; 12]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 13]::as_hex(self) -> Self::Display +pub fn &'a [u8; 13]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 14]::as_hex(self) -> Self::Display +pub fn &'a [u8; 14]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 15]::as_hex(self) -> Self::Display +pub fn &'a [u8; 15]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 16]::as_hex(self) -> Self::Display +pub fn &'a [u8; 16]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 1]::as_hex(self) -> Self::Display +pub fn &'a [u8; 1]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 2048]::as_hex(self) -> Self::Display +pub fn &'a [u8; 2048]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 20]::as_hex(self) -> Self::Display +pub fn &'a [u8; 20]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 256]::as_hex(self) -> Self::Display +pub fn &'a [u8; 256]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 2]::as_hex(self) -> Self::Display +pub fn &'a [u8; 2]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 32]::as_hex(self) -> Self::Display +pub fn &'a [u8; 32]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 33]::as_hex(self) -> Self::Display +pub fn &'a [u8; 33]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 3]::as_hex(self) -> Self::Display +pub fn &'a [u8; 3]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 4096]::as_hex(self) -> Self::Display +pub fn &'a [u8; 4096]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 4]::as_hex(self) -> Self::Display +pub fn &'a [u8; 4]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 512]::as_hex(self) -> Self::Display +pub fn &'a [u8; 512]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 5]::as_hex(self) -> Self::Display +pub fn &'a [u8; 5]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 64]::as_hex(self) -> Self::Display +pub fn &'a [u8; 64]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 65]::as_hex(self) -> Self::Display +pub fn &'a [u8; 65]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 6]::as_hex(self) -> Self::Display +pub fn &'a [u8; 6]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 7]::as_hex(self) -> Self::Display +pub fn &'a [u8; 7]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 8]::as_hex(self) -> Self::Display +pub fn &'a [u8; 8]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8; 9]::as_hex(self) -> Self::Display +pub fn &'a [u8; 9]::hex_reserve_suggestion(self) -> usize +pub fn &'a [u8]::as_hex(self) -> Self::Display +pub fn &'a [u8]::hex_reserve_suggestion(self) -> usize +pub fn hex_conservative::BytesToHexIter::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::BytesToHexIter::len(&self) -> usize +pub fn hex_conservative::BytesToHexIter::new(iter: I, case: hex_conservative::Case) -> hex_conservative::BytesToHexIter +pub fn hex_conservative::BytesToHexIter::next(&mut self) -> core::option::Option +pub fn hex_conservative::BytesToHexIter::next_back(&mut self) -> core::option::Option +pub fn hex_conservative::BytesToHexIter::size_hint(&self) -> (usize, core::option::Option) +pub fn hex_conservative::Case::clone(&self) -> hex_conservative::Case +pub fn hex_conservative::Case::default() -> Self +pub fn hex_conservative::Case::eq(&self, other: &hex_conservative::Case) -> bool +pub fn hex_conservative::Case::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::Case::hash<__H: core::hash::Hasher>(&self, state: &mut __H) +pub fn hex_conservative::DisplayHex::as_hex(self) -> Self::Display +pub fn hex_conservative::DisplayHex::hex_reserve_suggestion(self) -> usize +pub fn hex_conservative::HexToBytesIter::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::HexToBytesIter::from_pairs(iter: I) -> Self +pub fn hex_conservative::HexToBytesIter::next(&mut self) -> core::option::Option +pub fn hex_conservative::HexToBytesIter::next_back(&mut self) -> core::option::Option +pub fn hex_conservative::HexToBytesIter::nth(&mut self, n: usize) -> core::option::Option +pub fn hex_conservative::HexToBytesIter::nth_back(&mut self, n: usize) -> core::option::Option +pub fn hex_conservative::HexToBytesIter::size_hint(&self) -> (usize, core::option::Option) +pub fn hex_conservative::HexToBytesIter>::new(s: &'a str) -> core::result::Result +pub fn hex_conservative::buf_encoder::BufEncoder::as_str(&self) -> &str +pub fn hex_conservative::buf_encoder::BufEncoder::clear(&mut self) +pub fn hex_conservative::buf_encoder::BufEncoder::default() -> Self +pub fn hex_conservative::buf_encoder::BufEncoder::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::buf_encoder::BufEncoder::is_full(&self) -> bool +pub fn hex_conservative::buf_encoder::BufEncoder::new(case: hex_conservative::Case) -> Self +pub fn hex_conservative::buf_encoder::BufEncoder::put_byte(&mut self, byte: u8) +pub fn hex_conservative::buf_encoder::BufEncoder::put_bytes(&mut self, bytes: I) where I: core::iter::traits::collect::IntoIterator, ::Item: core::borrow::Borrow +pub fn hex_conservative::buf_encoder::BufEncoder::put_bytes_min<'a>(&mut self, bytes: &'a [u8]) -> &'a [u8] +pub fn hex_conservative::buf_encoder::BufEncoder::space_remaining(&self) -> usize +pub fn hex_conservative::decode_to_array(hex: &str) -> core::result::Result<[u8; N], hex_conservative::error::DecodeFixedLengthBytesError> +pub fn hex_conservative::display::DisplayArray<'_, LEN>::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::display::DisplayByteSlice<'_>::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::display::DisplayHex::as_hex(self) -> Self::Display +pub fn hex_conservative::display::DisplayHex::hex_reserve_suggestion(self) -> usize +pub fn hex_conservative::error::DecodeFixedLengthBytesError::clone(&self) -> hex_conservative::error::DecodeFixedLengthBytesError +pub fn hex_conservative::error::DecodeFixedLengthBytesError::eq(&self, other: &hex_conservative::error::DecodeFixedLengthBytesError) -> bool +pub fn hex_conservative::error::DecodeFixedLengthBytesError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::error::DecodeFixedLengthBytesError::from(e: hex_conservative::error::InvalidCharError) -> Self +pub fn hex_conservative::error::DecodeFixedLengthBytesError::from(e: hex_conservative::error::InvalidLengthError) -> Self +pub fn hex_conservative::error::DecodeFixedLengthBytesError::from(never: core::convert::Infallible) -> Self +pub fn hex_conservative::error::DecodeFixedLengthBytesError::offset(self, by_bytes: usize) -> Self +pub fn hex_conservative::error::DecodeVariableLengthBytesError::clone(&self) -> hex_conservative::error::DecodeVariableLengthBytesError +pub fn hex_conservative::error::DecodeVariableLengthBytesError::eq(&self, other: &hex_conservative::error::DecodeVariableLengthBytesError) -> bool +pub fn hex_conservative::error::DecodeVariableLengthBytesError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::error::DecodeVariableLengthBytesError::from(e: hex_conservative::error::InvalidCharError) -> Self +pub fn hex_conservative::error::DecodeVariableLengthBytesError::from(e: hex_conservative::error::OddLengthStringError) -> Self +pub fn hex_conservative::error::DecodeVariableLengthBytesError::from(never: core::convert::Infallible) -> Self +pub fn hex_conservative::error::DecodeVariableLengthBytesError::offset(self, by_bytes: usize) -> Self +pub fn hex_conservative::error::InvalidCharError::clone(&self) -> hex_conservative::error::InvalidCharError +pub fn hex_conservative::error::InvalidCharError::eq(&self, other: &hex_conservative::error::InvalidCharError) -> bool +pub fn hex_conservative::error::InvalidCharError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::error::InvalidCharError::from(never: core::convert::Infallible) -> Self +pub fn hex_conservative::error::InvalidCharError::offset(self, by_bytes: usize) -> Self +pub fn hex_conservative::error::InvalidCharError::pos(&self) -> usize +pub fn hex_conservative::error::InvalidLengthError::clone(&self) -> hex_conservative::error::InvalidLengthError +pub fn hex_conservative::error::InvalidLengthError::eq(&self, other: &hex_conservative::error::InvalidLengthError) -> bool +pub fn hex_conservative::error::InvalidLengthError::expected_length(&self) -> usize +pub fn hex_conservative::error::InvalidLengthError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::error::InvalidLengthError::from(never: core::convert::Infallible) -> Self +pub fn hex_conservative::error::InvalidLengthError::invalid_length(&self) -> usize +pub fn hex_conservative::error::OddLengthStringError::clone(&self) -> hex_conservative::error::OddLengthStringError +pub fn hex_conservative::error::OddLengthStringError::eq(&self, other: &hex_conservative::error::OddLengthStringError) -> bool +pub fn hex_conservative::error::OddLengthStringError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn hex_conservative::error::OddLengthStringError::from(never: core::convert::Infallible) -> Self +pub fn hex_conservative::error::OddLengthStringError::length(&self) -> usize +pub fn hex_conservative::prelude::DisplayHex::as_hex(self) -> Self::Display +pub fn hex_conservative::prelude::DisplayHex::hex_reserve_suggestion(self) -> usize +pub hex_conservative::Case::Lower +pub hex_conservative::Case::Upper +pub hex_conservative::DecodeFixedLengthBytesError::InvalidChar(hex_conservative::error::InvalidCharError) +pub hex_conservative::DecodeFixedLengthBytesError::InvalidLength(hex_conservative::error::InvalidLengthError) +pub hex_conservative::DecodeVariableLengthBytesError::InvalidChar(hex_conservative::error::InvalidCharError) +pub hex_conservative::DecodeVariableLengthBytesError::OddLengthString(hex_conservative::error::OddLengthStringError) +pub hex_conservative::error::DecodeFixedLengthBytesError::InvalidChar(hex_conservative::error::InvalidCharError) +pub hex_conservative::error::DecodeFixedLengthBytesError::InvalidLength(hex_conservative::error::InvalidLengthError) +pub hex_conservative::error::DecodeVariableLengthBytesError::InvalidChar(hex_conservative::error::InvalidCharError) +pub hex_conservative::error::DecodeVariableLengthBytesError::OddLengthString(hex_conservative::error::OddLengthStringError) +pub macro hex_conservative::display::fmt_hex_exact! +pub macro hex_conservative::display::impl_fmt_traits! +pub macro hex_conservative::fmt_hex_exact! +pub macro hex_conservative::hex! +pub macro hex_conservative::impl_fmt_traits! +pub mod hex_conservative +pub mod hex_conservative::buf_encoder +pub mod hex_conservative::display +pub mod hex_conservative::error +pub mod hex_conservative::prelude +pub struct hex_conservative::BytesToHexIter where I: core::iter::traits::iterator::Iterator, ::Item: core::borrow::Borrow +pub struct hex_conservative::HexToBytesIter where I: core::iter::traits::iterator::Iterator +pub struct hex_conservative::InvalidCharError +pub struct hex_conservative::InvalidLengthError +pub struct hex_conservative::OddLengthStringError +pub struct hex_conservative::buf_encoder::BufEncoder +pub struct hex_conservative::display::DisplayArray<'a, const CAP: usize> +pub struct hex_conservative::display::DisplayByteSlice<'a> +pub struct hex_conservative::error::InvalidCharError +pub struct hex_conservative::error::InvalidLengthError +pub struct hex_conservative::error::OddLengthStringError +pub trait hex_conservative::DisplayHex: core::marker::Copy + hex_conservative::display::sealed::IsRef + hex_conservative::display::sealed::Sealed +pub trait hex_conservative::display::DisplayHex: core::marker::Copy + hex_conservative::display::sealed::IsRef + hex_conservative::display::sealed::Sealed +pub trait hex_conservative::prelude::DisplayHex: core::marker::Copy + hex_conservative::display::sealed::IsRef + hex_conservative::display::sealed::Sealed +pub type &'a [u8; 1024]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 10]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 11]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 128]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 12]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 13]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 14]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 15]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 16]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 1]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 2048]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 20]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 256]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 2]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 32]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 33]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 3]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 4096]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 4]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 512]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 5]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 64]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 65]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 6]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 7]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 8]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8; 9]::Display = hex_conservative::display::DisplayArray<'a, {$len * 2}> +pub type &'a [u8]::Display = hex_conservative::display::DisplayByteSlice<'a> +pub type hex_conservative::BytesToHexIter::Item = char +pub type hex_conservative::DisplayHex::Display: core::fmt::Display + core::fmt::Debug + core::fmt::LowerHex + core::fmt::UpperHex +pub type hex_conservative::HexSliceToBytesIter<'a> = hex_conservative::HexToBytesIter> +pub type hex_conservative::HexToBytesIter::Item = core::result::Result +pub type hex_conservative::display::DisplayHex::Display: core::fmt::Display + core::fmt::Debug + core::fmt::LowerHex + core::fmt::UpperHex +pub type hex_conservative::prelude::DisplayHex::Display: core::fmt::Display + core::fmt::Debug + core::fmt::LowerHex + core::fmt::UpperHex diff --git a/contrib/check-for-api-changes.sh b/contrib/check-for-api-changes.sh new file mode 100755 index 00000000..b362f917 --- /dev/null +++ b/contrib/check-for-api-changes.sh @@ -0,0 +1,87 @@ +#!/usr/bin/env bash +# +# Checks the public API of crates, exits with non-zero if there are currently +# changes to the public API not already committed to in the various api/*.txt +# files. + +set -euo pipefail + +REPO_DIR=$(git rev-parse --show-toplevel) +API_DIR="$REPO_DIR/api" + +NIGHTLY=$(cat "$REPO_DIR/nightly-version") +# Our docs have broken intra doc links if all features are not enabled. +RUSTDOCFLAGS="-A rustdoc::broken_intra_doc_links" + +# `sort -n -u` doesn't work for some reason. +SORT="sort --numeric-sort" + +# Sort order is affected by locale. See `man sort`. +# > Set LC_ALL=C to get the traditional sort order that uses native byte values. +export LC_ALL=C + +main() { + need_nightly + need_cargo_public_api + + # If script is running in CI the recent lock file is copied into place + # already by the github action job. Locally be kind to the environment. + if [ "${GITHUB_ACTIONS:-}" != "true" ]; then + [ -f "Cargo.lock" ] && mv Cargo.lock Cargo.lock.tmp + cp Cargo-recent.lock Cargo.lock + fi + + run_cargo --no-default-features | $SORT | uniq > "$API_DIR/no-features.txt" + run_cargo --no-default-features --features=alloc | $SORT | uniq > "$API_DIR/alloc-only.txt" + run_cargo_all_features | $SORT | uniq > "$API_DIR/all-features.txt" + + [ -f "Cargo.lock.tmp" ] && mv Cargo.lock.tmp Cargo.lock + + check_for_changes +} + +# Check if there are changes (dirty git index) to the `api/` directory. +check_for_changes() { + if [[ $(git status --porcelain api) ]]; then + git diff --color=always + echo + err "You have introduced changes to the public API, commit the changes to api/ currently in your working directory" + else + echo "No changes to the current public API" + fi +} + +# Run cargo when --all-features is not used. +run_cargo() { + RUSTDOCFLAGS="$RUSTDOCFLAGS" cargo +"$NIGHTLY" --locked public-api --simplified "$@" +} + +# Run cargo with all features enabled. +run_cargo_all_features() { + cargo +"$NIGHTLY" --locked public-api --simplified --all-features +} + +need_nightly() { + cargo_ver=$(cargo +"$NIGHTLY" --version) + if echo "$cargo_ver" | grep -q -v nightly; then + err "Need a nightly compiler; have $cargo_ver" + fi +} + +need_cargo_public_api() { + if command -v cargo-public-api > /dev/null; then + return + fi + err "cargo-public-api is not installed; please run 'cargo +nightly install cargo-public-api --locked'" +} + +err() { + echo "$1" >&2 + exit 1 +} + +# +# Main script +# +main "$@" +exit 0 diff --git a/contrib/test_vars.sh b/contrib/test_vars.sh index 72f332f2..42783ff2 100644 --- a/contrib/test_vars.sh +++ b/contrib/test_vars.sh @@ -5,10 +5,10 @@ # shellcheck disable=SC2034 # Test all these features with "std" enabled. -FEATURES_WITH_STD="serde newer-rust-version" +FEATURES_WITH_STD="newer-rust-version" # Test all these features without "std" or "alloc" enabled. -FEATURES_WITHOUT_STD="alloc serde newer-rust-version" +FEATURES_WITHOUT_STD="alloc newer-rust-version" # Run these examples. -EXAMPLES="hexy:std wrap_array:std serde:std,serde" +EXAMPLES="hexy:std wrap_array:std" diff --git a/examples/hexy.rs b/examples/hexy.rs index a6ad1f5b..c8fa4140 100644 --- a/examples/hexy.rs +++ b/examples/hexy.rs @@ -9,7 +9,7 @@ use std::fmt; use std::str::FromStr; use hex_conservative::{ - fmt_hex_exact, Case, DecodeFixedLengthBytesError, DisplayHex as _, FromHex as _, + self as hex, fmt_hex_exact, Case, DecodeFixedLengthBytesError, DisplayHex as _, }; fn main() { @@ -52,7 +52,7 @@ impl FromStr for Hexy { fn from_str(s: &str) -> Result { // Errors if the input is invalid - let a = <[u8; 32]>::from_hex(s)?; + let a = hex::decode_to_array::<32>(s)?; Ok(Hexy { data: a }) } } diff --git a/examples/serde.rs b/examples/serde.rs deleted file mode 100644 index 3cef8b65..00000000 --- a/examples/serde.rs +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: CC0-1.0 - -//! Demonstrate how to use the serde module with struct fields. - -#![allow(clippy::disallowed_names)] // Foo is a valid name. - -use hex_conservative as hex; -use serde::{Deserialize, Serialize}; - -/// Abstracts over foo. -#[derive(Debug, Serialize, Deserialize)] -pub struct Foo { - // serialized as a hexadecimal string. - #[serde(with = "hex::serde")] - pub u: Vec, - // serialized as an array of decimal integers. - pub v: Vec, -} - -fn main() { - let v = vec![0xde, 0xad, 0xbe, 0xef]; - - let foo = Foo { u: v.clone(), v }; - let ser = serde_json::to_string(&foo).expect("failed to serialize foo"); - - // Prints: - // - // foo: {"u":"deadbeef","v":[222,173,190,239]} - // - println!("\nfoo: {}", ser); -} diff --git a/examples/wrap_array.rs b/examples/wrap_array.rs index 3e02f521..72cdbf1e 100644 --- a/examples/wrap_array.rs +++ b/examples/wrap_array.rs @@ -7,13 +7,13 @@ use core::fmt; use core::str::FromStr; -use hex_conservative::{DecodeFixedLengthBytesError, DisplayHex as _, FromHex as _}; +use hex_conservative::{self as hex, DecodeFixedLengthBytesError, DisplayHex as _}; fn main() { let hex = "deadbeefcafebabedeadbeefcafebabedeadbeefcafebabedeadbeefcafebabe"; println!("\nParse from hex: {}\n", hex); - let array = <[u8; 32]>::from_hex(hex).expect("failed to parse array"); + let array = hex::decode_to_array::<32>(hex).expect("failed to parse array"); let wrap = Wrap::from_str(hex).expect("failed to parse wrapped array from hex string"); println!("Print an array using traits from the standard libraries `fmt` module along with the provided implementation of `DisplayHex`:\n"); @@ -73,5 +73,5 @@ impl fmt::UpperHex for Wrap { impl FromStr for Wrap { type Err = DecodeFixedLengthBytesError; - fn from_str(s: &str) -> Result { Ok(Self(<[u8; 32]>::from_hex(s)?)) } + fn from_str(s: &str) -> Result { Ok(Self(hex::decode_to_array::<32>(s)?)) } } diff --git a/fuzz/fuzz_targets/hex.rs b/fuzz/fuzz_targets/hex.rs index 8d78c588..81f2fad9 100644 --- a/fuzz/fuzz_targets/hex.rs +++ b/fuzz/fuzz_targets/hex.rs @@ -1,11 +1,11 @@ -use hex::{DisplayHex, FromHex}; +use hex::DisplayHex; use honggfuzz::fuzz; const LEN: usize = 32; // Arbitrary amount of data. fn do_test(data: &[u8]) { if let Ok(s) = std::str::from_utf8(data) { - if let Ok(hexy) = <[u8; LEN]>::from_hex(s) { + if let Ok(hexy) = hex::decode_to_array::(s) { let got = format!("{:x}", hexy.as_hex()); assert_eq!(got, s.to_lowercase()); } diff --git a/src/error.rs b/src/error.rs index b5f2c6e6..1e3068c0 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,6 +1,10 @@ // SPDX-License-Identifier: CC0-1.0 -//! Error code for the `hex-conservative` crate. +//! The error types. +//! +//! These types are returned when hex decoding fails. The high-level ones are +//! [`DecodeFixedLengthBytesError`] and [`DecodeVariableLengthBytesError`] which represent all +//! possible ways in which hex decoding may fail in the two most common decoding scenarios. use core::convert::Infallible; use core::fmt; @@ -405,11 +409,11 @@ if_std_error! {{ #[cfg(test)] #[cfg(feature = "std")] mod tests { - #[cfg(feature = "alloc")] - use alloc::vec::Vec; - use super::*; - use crate::FromHex; + #[cfg(feature = "alloc")] + use crate::decode_to_vec; + use crate::error::{InvalidCharError, OddLengthStringError}; + use crate::{decode_to_array, HexToBytesIter, InvalidLengthError}; fn check_source(error: &T) { assert!(error.source().is_some()); @@ -418,7 +422,7 @@ mod tests { #[cfg(feature = "alloc")] #[test] fn invalid_char_error() { - let result = as FromHex>::from_hex("12G4"); + let result = decode_to_vec("12G4"); let error = result.unwrap_err(); if let DecodeVariableLengthBytesError::InvalidChar(e) = error { assert!(!format!("{}", e).is_empty()); @@ -432,7 +436,7 @@ mod tests { #[cfg(feature = "alloc")] #[test] fn odd_length_string_error() { - let result = as FromHex>::from_hex("123"); + let result = decode_to_vec("123"); let error = result.unwrap_err(); assert!(!format!("{}", error).is_empty()); check_source(&error); @@ -446,7 +450,7 @@ mod tests { #[test] fn invalid_length_error() { - let result = <[u8; 4] as FromHex>::from_hex("123"); + let result = decode_to_array::<4>("123"); let error = result.unwrap_err(); assert!(!format!("{}", error).is_empty()); check_source(&error); @@ -476,4 +480,85 @@ mod tests { assert!(!format!("{}", error).is_empty()); check_source(&error); } + + #[test] + #[cfg(feature = "alloc")] + fn hex_error() { + let oddlen = "0123456789abcdef0"; + let badchar1 = "Z123456789abcdef"; + let badchar2 = "012Y456789abcdeb"; + let badchar3 = "«23456789abcdef"; + + assert_eq!(decode_to_vec(oddlen).unwrap_err(), OddLengthStringError { len: 17 }.into()); + assert_eq!( + decode_to_array::<4>(oddlen).unwrap_err(), + InvalidLengthError { invalid: 17, expected: 8 }.into() + ); + assert_eq!( + decode_to_vec(badchar1).unwrap_err(), + InvalidCharError { pos: 0, invalid: b'Z' }.into() + ); + assert_eq!( + decode_to_vec(badchar2).unwrap_err(), + InvalidCharError { pos: 3, invalid: b'Y' }.into() + ); + assert_eq!( + decode_to_vec(badchar3).unwrap_err(), + InvalidCharError { pos: 0, invalid: 194 }.into() + ); + } + + #[test] + fn hex_error_position() { + let badpos1 = "Z123456789abcdef"; + let badpos2 = "012Y456789abcdeb"; + let badpos3 = "0123456789abcdeZ"; + let badpos4 = "0123456789abYdef"; + + assert_eq!( + HexToBytesIter::new(badpos1).unwrap().next().unwrap().unwrap_err(), + InvalidCharError { pos: 0, invalid: b'Z' } + ); + assert_eq!( + HexToBytesIter::new(badpos2).unwrap().nth(1).unwrap().unwrap_err(), + InvalidCharError { pos: 3, invalid: b'Y' } + ); + assert_eq!( + HexToBytesIter::new(badpos3).unwrap().next_back().unwrap().unwrap_err(), + InvalidCharError { pos: 15, invalid: b'Z' } + ); + assert_eq!( + HexToBytesIter::new(badpos4).unwrap().nth_back(1).unwrap().unwrap_err(), + InvalidCharError { pos: 12, invalid: b'Y' } + ); + } + + #[test] + fn hex_to_array() { + let len_sixteen = "0123456789abcdef"; + assert!(decode_to_array::<8>(len_sixteen).is_ok()); + } + + #[test] + fn hex_to_array_error() { + let len_sixteen = "0123456789abcdef"; + assert_eq!( + decode_to_array::<4>(len_sixteen).unwrap_err(), + InvalidLengthError { invalid: 16, expected: 8 }.into() + ); + } + + #[test] + #[cfg(feature = "alloc")] + fn mixed_case() { + use crate::display::DisplayHex as _; + + let s = "DEADbeef0123"; + let want_lower = "deadbeef0123"; + let want_upper = "DEADBEEF0123"; + + let v = decode_to_vec(s).expect("valid hex"); + assert_eq!(format!("{:x}", v.as_hex()), want_lower); + assert_eq!(format!("{:X}", v.as_hex()), want_upper); + } } diff --git a/src/lib.rs b/src/lib.rs index cdaa2339..86d03511 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -22,9 +22,9 @@ //! use hex::prelude::*; //! //! // Decode an arbitrary length hex string into a vector. -//! let v = Vec::from_hex("deadbeef").expect("valid hex digits"); +//! let v = hex::decode_to_vec("deadbeef").expect("valid hex digits"); //! // Or a known length hex string into a fixed size array. -//! let a = <[u8; 4]>::from_hex("deadbeef").expect("valid length and valid hex digits"); +//! let a = hex::decode_to_array::<4>("deadbeef").expect("valid length and valid hex digits"); //! //! // We support `LowerHex` and `UpperHex` out of the box for `[u8]` slices. //! println!("An array as lower hex: {:x}", a.as_hex()); @@ -37,8 +37,8 @@ //! // Please note, mixed case strings will still parse successfully but we only //! // support displaying hex in a single case. //! assert_eq!( -//! Vec::from_hex("dEaDbEeF").expect("valid mixed case hex digits"), -//! Vec::from_hex("deadbeef").expect("valid hex digits"), +//! hex::decode_to_vec("dEaDbEeF").expect("valid mixed case hex digits"), +//! hex::decode_to_vec("deadbeef").expect("valid hex digits"), //! ); //! # } //! ``` @@ -101,46 +101,11 @@ pub mod buf_encoder; pub mod display; pub mod error; mod iter; -pub mod parse; -#[cfg(feature = "serde")] -pub mod serde; - -/// Parses hex strings in const contexts. -/// -/// Returns `[u8; N]` arrays. The string must have even length. -#[macro_export] -macro_rules! hex { - ($hex:expr) => {{ - const _: () = assert!($hex.len() % 2 == 0, "hex string must have even length"); - - const fn decode_digit(digit: u8) -> u8 { - match digit { - b'0'..=b'9' => digit - b'0', - b'a'..=b'f' => digit - b'a' + 10, - b'A'..=b'F' => digit - b'A' + 10, - _ => panic!("invalid hex digit"), - } - } - - let mut output = [0u8; $hex.len() / 2]; - let bytes = $hex.as_bytes(); - - let mut i = 0; - while i < output.len() { - let high = decode_digit(bytes[i * 2]); - let low = decode_digit(bytes[i * 2 + 1]); - output[i] = (high << 4) | low; - i += 1; - } - - output - }}; -} /// Re-exports of the common crate traits. pub mod prelude { #[doc(inline)] - pub use crate::{display::DisplayHex, parse::FromHex}; + pub use crate::display::DisplayHex; } #[cfg(feature = "alloc")] @@ -157,7 +122,6 @@ pub use self::{ OddLengthStringError, }, iter::{BytesToHexIter, HexToBytesIter, HexSliceToBytesIter}, - parse::FromHex, }; /// Decodes a hex string with variable length. @@ -194,6 +158,38 @@ pub fn decode_to_array(hex: &str) -> Result<[u8; N], DecodeFixed } } +/// Parses hex strings in const contexts. +/// +/// Returns `[u8; N]` arrays. The string must have even length. +#[macro_export] +macro_rules! hex { + ($hex:expr) => {{ + const _: () = assert!($hex.len() % 2 == 0, "hex string must have even length"); + + const fn decode_digit(digit: u8) -> u8 { + match digit { + b'0'..=b'9' => digit - b'0', + b'a'..=b'f' => digit - b'a' + 10, + b'A'..=b'F' => digit - b'A' + 10, + _ => panic!("invalid hex digit"), + } + } + + let mut output = [0u8; $hex.len() / 2]; + let bytes = $hex.as_bytes(); + + let mut i = 0; + while i < output.len() { + let high = decode_digit(bytes[i * 2]); + let low = decode_digit(bytes[i * 2 + 1]); + output[i] = (high << 4) | low; + i += 1; + } + + output + }}; +} + /// Possible case of hex. #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum Case { @@ -268,26 +264,9 @@ mod table { } } -/// Quick and dirty macro for parsing hex in tests. -/// -/// For improved ergonomics import with: `use hex_conservative::test_hex_unwrap as hex;` -#[macro_export] -#[deprecated(since = "TBD", note = "use the one-liner `Vec::from_hex(hex).unwrap()` instead")] -#[cfg(feature = "alloc")] -macro_rules! test_hex_unwrap (($hex:expr) => ( as $crate::FromHex>::from_hex($hex).unwrap())); - #[cfg(test)] #[cfg(feature = "alloc")] mod tests { - use alloc::vec::Vec; - - #[test] - fn parse_hex_into_vector() { - let got = crate::test_hex_unwrap!("deadbeef"); - let want = vec![0xde, 0xad, 0xbe, 0xef]; - assert_eq!(got, want); - } - #[test] fn hex_macro() { let data = hex!("deadbeef"); diff --git a/src/parse.rs b/src/parse.rs deleted file mode 100644 index 0c99fb0b..00000000 --- a/src/parse.rs +++ /dev/null @@ -1,141 +0,0 @@ -// SPDX-License-Identifier: CC0-1.0 - -//! Hex encoding and decoding. - -use core::{fmt, str}; - -#[cfg(feature = "alloc")] -use crate::alloc::vec::Vec; - -#[rustfmt::skip] // Keep public re-exports separate. -pub use crate::error::{DecodeVariableLengthBytesError, DecodeFixedLengthBytesError}; - -/// Trait for objects that can be deserialized from hex strings. -pub trait FromHex: Sized + sealed::Sealed { - /// Error type returned while parsing hex string. - type Error: Sized + fmt::Debug + fmt::Display; - - /// Produces an object from a hex string. - /// - /// # Errors - /// - /// Errors if parsing of hex string fails for any reason. - fn from_hex(s: &str) -> Result; -} - -#[cfg(feature = "alloc")] -impl FromHex for Vec { - type Error = DecodeVariableLengthBytesError; - - #[inline] - fn from_hex(s: &str) -> Result { crate::decode_to_vec(s) } -} - -impl FromHex for [u8; LEN] { - type Error = DecodeFixedLengthBytesError; - - fn from_hex(s: &str) -> Result { crate::decode_to_array(s) } -} - -mod sealed { - /// Used to seal the `FromHex` trait. - pub trait Sealed {} - - #[cfg(feature = "alloc")] - impl Sealed for alloc::vec::Vec {} - - impl Sealed for [u8; LEN] {} -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::{HexToBytesIter, InvalidLengthError}; - - #[test] - #[cfg(feature = "alloc")] - fn hex_error() { - use crate::error::{InvalidCharError, OddLengthStringError}; - - let oddlen = "0123456789abcdef0"; - let badchar1 = "Z123456789abcdef"; - let badchar2 = "012Y456789abcdeb"; - let badchar3 = "«23456789abcdef"; - - assert_eq!( - Vec::::from_hex(oddlen).unwrap_err(), - OddLengthStringError { len: 17 }.into() - ); - assert_eq!( - <[u8; 4]>::from_hex(oddlen).unwrap_err(), - InvalidLengthError { invalid: 17, expected: 8 }.into() - ); - assert_eq!( - Vec::::from_hex(badchar1).unwrap_err(), - InvalidCharError { pos: 0, invalid: b'Z' }.into() - ); - assert_eq!( - Vec::::from_hex(badchar2).unwrap_err(), - InvalidCharError { pos: 3, invalid: b'Y' }.into() - ); - assert_eq!( - Vec::::from_hex(badchar3).unwrap_err(), - InvalidCharError { pos: 0, invalid: 194 }.into() - ); - } - - #[test] - fn hex_error_position() { - use crate::error::InvalidCharError; - let badpos1 = "Z123456789abcdef"; - let badpos2 = "012Y456789abcdeb"; - let badpos3 = "0123456789abcdeZ"; - let badpos4 = "0123456789abYdef"; - - assert_eq!( - HexToBytesIter::new(badpos1).unwrap().next().unwrap().unwrap_err(), - InvalidCharError { pos: 0, invalid: b'Z' } - ); - assert_eq!( - HexToBytesIter::new(badpos2).unwrap().nth(1).unwrap().unwrap_err(), - InvalidCharError { pos: 3, invalid: b'Y' } - ); - assert_eq!( - HexToBytesIter::new(badpos3).unwrap().next_back().unwrap().unwrap_err(), - InvalidCharError { pos: 15, invalid: b'Z' } - ); - assert_eq!( - HexToBytesIter::new(badpos4).unwrap().nth_back(1).unwrap().unwrap_err(), - InvalidCharError { pos: 12, invalid: b'Y' } - ); - } - - #[test] - fn hex_to_array() { - let len_sixteen = "0123456789abcdef"; - assert!(<[u8; 8]>::from_hex(len_sixteen).is_ok()); - } - - #[test] - fn hex_to_array_error() { - let len_sixteen = "0123456789abcdef"; - assert_eq!( - <[u8; 4]>::from_hex(len_sixteen).unwrap_err(), - InvalidLengthError { invalid: 16, expected: 8 }.into() - ); - } - - #[test] - #[cfg(feature = "alloc")] - fn mixed_case() { - use crate::display::DisplayHex as _; - - let s = "DEADbeef0123"; - let want_lower = "deadbeef0123"; - let want_upper = "DEADBEEF0123"; - - let v = Vec::::from_hex(s).expect("valid hex"); - assert_eq!(format!("{:x}", v.as_hex()), want_lower); - assert_eq!(format!("{:X}", v.as_hex()), want_upper); - } -} diff --git a/src/serde.rs b/src/serde.rs deleted file mode 100644 index 1aa7bfb9..00000000 --- a/src/serde.rs +++ /dev/null @@ -1,186 +0,0 @@ -//! Hex encoding with `serde`. -//! -//! The functions in this module de/serialize as hex _only_ when the serializer is human readable. -//! -//! # Examples -//! -//! ``` -//! # #[cfg(feature = "std")] { -//! use hex_conservative as hex; -//! use serde::{Serialize, Deserialize}; -//! -//! #[derive(Debug, Serialize, Deserialize)] -//! struct Foo { -//! #[serde(with = "hex::serde")] -//! bar: Vec, -//! } -//! # } -//! ``` - -use core::fmt; -use core::marker::PhantomData; - -use serde::de::{Error, Visitor}; -use serde::{Deserialize, Deserializer, Serialize, Serializer}; - -use crate::prelude::*; - -/// Serializes `data` as a hex string using lowercase characters. -/// -/// We only serialize as hex if the serializer is human readable, if not we call through to the -/// `Serialize` implementation for `data`. -/// -/// # Errors -/// -/// Returns the serializer error if one occurs. -pub fn serialize(data: T, s: S) -> Result -where - S: Serializer, - T: Serialize + DisplayHex, -{ - serialize_lower(data, s) -} - -/// Serializes `data` as a hex string using lowercase characters. -/// -/// We only serialize as hex if the serializer is human readable, if not we call through to the -/// `Serialize` implementation for `data`. -/// -/// # Errors -/// -/// Returns the serializer error if one occurs. -pub fn serialize_lower(data: T, serializer: S) -> Result -where - S: Serializer, - T: Serialize + DisplayHex, -{ - // Don't do anything special when not human readable. - if serializer.is_human_readable() { - serializer.collect_str(&format_args!("{:x}", data.as_hex())) - } else { - serde::Serialize::serialize(&data, serializer) - } -} - -/// Serializes `data` as hex string using uppercase characters. -/// -/// We only serialize as hex if the serializer is human readable, if not we call through to the -/// `Serialize` implementation for `data`. -/// -/// # Errors -/// -/// Returns the serializer error if one occurs. -pub fn serialize_upper(data: T, serializer: S) -> Result -where - S: Serializer, - T: Serialize + DisplayHex, -{ - // Don't do anything special when not human readable. - if serializer.is_human_readable() { - serializer.collect_str(&format_args!("{:X}", data.as_hex())) - } else { - serde::Serialize::serialize(&data, serializer) - } -} - -/// Byte slice wrapper to serialize as a hex string in lowercase characters. -#[derive(Debug)] -pub struct SerializeBytesAsHex<'a>(pub &'a [u8]); - -impl serde::Serialize for SerializeBytesAsHex<'_> { - fn serialize(&self, serializer: S) -> Result - where - S: serde::Serializer, - { - serialize_lower(self.0, serializer) - } -} - -/// Byte slice wrapper to serialize as a hex string in lowercase characters. -#[derive(Debug)] -pub struct SerializeBytesAsHexLower<'a>(pub &'a [u8]); - -impl serde::Serialize for SerializeBytesAsHexLower<'_> { - fn serialize(&self, serializer: S) -> Result - where - S: serde::Serializer, - { - serialize_lower(self.0, serializer) - } -} - -/// Byte slice wrapper to serialize as a hex string in uppercase characters. -#[derive(Debug)] -pub struct SerializeBytesAsHexUpper<'a>(pub &'a [u8]); - -impl serde::Serialize for SerializeBytesAsHexUpper<'_> { - fn serialize(&self, serializer: S) -> Result - where - S: serde::Serializer, - { - serialize_upper(self.0, serializer) - } -} - -/// Deserializes a hex string into raw bytes. -/// -/// Allows upper, lower, and mixed case characters (e.g. `a5b3c1`, `A5B3C1` and `A5b3C1`). -/// -/// We only deserialize from hex if the serializer is human readable, if not we call through to the -/// `Deserialize` implementation for `T`. -/// -/// # Errors -/// -/// Returns the deserializer error if one occurs. -pub fn deserialize<'de, D, T>(d: D) -> Result -where - D: Deserializer<'de>, - T: Deserialize<'de> + FromHex, -{ - struct HexVisitor(PhantomData); - - impl Visitor<'_> for HexVisitor - where - T: FromHex, - { - type Value = T; - - fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.write_str("an ASCII hex string") - } - - fn visit_str(self, data: &str) -> Result { - FromHex::from_hex(data).map_err(Error::custom) - } - } - - // Don't do anything special when not human readable. - if d.is_human_readable() { - d.deserialize_str(HexVisitor(PhantomData)) - } else { - serde::Deserialize::deserialize(d) - } -} - -#[cfg(test)] -mod test { - #[test] - fn serialize_lower_roundtrip() -> Result<(), serde_json::Error> { - let bytes: [u8; 4] = [0xde, 0xad, 0xbe, 0xef]; - let serialized: serde_json::Value = - super::serialize_lower(&bytes, serde_json::value::Serializer)?; - let deserialized: [u8; 4] = super::deserialize(serialized)?; - assert_eq!(bytes, deserialized); - Ok(()) - } - - #[test] - fn serialize_upper_roundtrip() -> Result<(), serde_json::Error> { - let bytes: [u8; 4] = [0xde, 0xad, 0xbe, 0xef]; - let serialized: serde_json::Value = - super::serialize_upper(&bytes, serde_json::value::Serializer)?; - let deserialized: [u8; 4] = super::deserialize(serialized)?; - assert_eq!(bytes, deserialized); - Ok(()) - } -} diff --git a/tests/api.rs b/tests/api.rs index 8c758c11..008e5c53 100644 --- a/tests/api.rs +++ b/tests/api.rs @@ -13,8 +13,6 @@ use core::borrow::Borrow; use core::marker::PhantomData; use core::{fmt, slice}; -#[cfg(feature = "serde")] -use hex_conservative::serde; // These imports test "typical" usage by user code. use hex_conservative::{ buf_encoder, display, BytesToHexIter, Case, DecodeFixedLengthBytesError, @@ -52,13 +50,7 @@ where d: display::DisplayByteSlice<'a>, #[cfg(feature = "std")] e: display::HexWriter, - #[cfg(feature = "serde")] - f: serde::SerializeBytesAsHex<'a>, - #[cfg(feature = "serde")] - g: serde::SerializeBytesAsHexLower<'a>, - #[cfg(feature = "serde")] - h: serde::SerializeBytesAsHexUpper<'a>, - _i: PhantomData, // For when `std` is not enabled. + _marker: PhantomData, // For when `std` is not enabled. } impl Structs<'_, slice::Iter<'_, u8>, String> { @@ -72,13 +64,7 @@ impl Structs<'_, slice::Iter<'_, u8>, String> { d: BYTES[..].as_hex(), #[cfg(feature = "std")] e: display::HexWriter::new(String::new(), Case::Lower), - #[cfg(feature = "serde")] - f: serde::SerializeBytesAsHex(&BYTES), - #[cfg(feature = "serde")] - g: serde::SerializeBytesAsHexLower(&BYTES), - #[cfg(feature = "serde")] - h: serde::SerializeBytesAsHexUpper(&BYTES), - _i: PhantomData, + _marker: PhantomData, } } } @@ -113,15 +99,6 @@ fn api_all_non_error_types_have_non_empty_debug() { #[cfg(feature = "std")] let debug = format!("{:?}", t.e); assert!(!debug.is_empty()); - #[cfg(feature = "serde")] - { - let debug = format!("{:?}", t.f); - assert!(!debug.is_empty()); - let debug = format!("{:?}", t.g); - assert!(!debug.is_empty()); - let debug = format!("{:?}", t.h); - assert!(!debug.is_empty()); - } } #[test]