Add ExactSizeEncoder for known-length Encoders
What changed, and why it matters
This commit is a routine feature addition to the Rust Bitcoin library. It introduces a new ExactSizeEncoder trait that lets callers ask fixed-size encoders how many bytes they will produce, and adds an ExactSizeIterator implementation for the byte iterator. There is no security fix or vulnerability here; it is purely an API enhancement with tests.
No security action required. Treat as a normal library feature/API change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit adds an ExactSizeEncoder trait (extending Encoder) with len()/is_empty() methods, implements it for ArrayEncoder, BytesEncoder, CompactSizeEncoder, and the composed Encoder2/3/4/6 types, and provides an encoder_newtype_exact! macro for newtype wrappers. It also implements ExactSizeIterator for EncodableByteIter when the underlying encoder is exact-size. Existing fixed-size newtype encoders across primitives, units, and p2p are migrated to the new macro. The change is additive, well-tested, and does not alter encoding semantics.
Changed components
bitcoin_consensus_encoding::encode modulebitcoin_consensus_encoding encoder macrosbitcoin_primitives encodersbitcoin_units encodersbitcoin_p2p FeeFilter encoderInspect captured patch +289 / −32
diff --git a/api/consensus_encoding/all-features.txt b/api/consensus_encoding/all-features.txt
index 35d374b5..61104294 100644
--- a/api/consensus_encoding/all-features.txt
+++ b/api/consensus_encoding/all-features.txt
@@ -5,6 +5,7 @@ impl bitcoin_consensus_encoding::Decoder for bitcoin_consensus_encoding::ByteVec
impl bitcoin_consensus_encoding::Decoder for bitcoin_consensus_encoding::CompactSizeDecoder
impl bitcoin_consensus_encoding::Encoder for bitcoin_consensus_encoding::BytesEncoder<'_>
impl bitcoin_consensus_encoding::Encoder for bitcoin_consensus_encoding::CompactSizeEncoder
+impl bitcoin_consensus_encoding::ExactSizeEncoder for bitcoin_consensus_encoding::CompactSizeEncoder
impl core::clone::Clone for bitcoin_consensus_encoding::ByteVecDecoderError
impl core::clone::Clone for bitcoin_consensus_encoding::CompactSizeDecoder
impl core::clone::Clone for bitcoin_consensus_encoding::CompactSizeDecoderError
@@ -89,6 +90,7 @@ impl<'e, T> core::panic::unwind_safe::RefUnwindSafe for bitcoin_consensus_encodi
impl<'e, T> core::panic::unwind_safe::UnwindSafe for bitcoin_consensus_encoding::SliceEncoder<'e, T> where <T as bitcoin_consensus_encoding::Encodable>::Encoder: core::panic::unwind_safe::UnwindSafe, T: core::panic::unwind_safe::RefUnwindSafe
impl<'s, T: bitcoin_consensus_encoding::Encodable + 's> bitcoin_consensus_encoding::EncodableByteIter<'s, T>
impl<'s, T: bitcoin_consensus_encoding::Encodable + 's> core::iter::traits::iterator::Iterator for bitcoin_consensus_encoding::EncodableByteIter<'s, T>
+impl<'s, T> core::iter::traits::exact_size::ExactSizeIterator for bitcoin_consensus_encoding::EncodableByteIter<'s, T> where T: bitcoin_consensus_encoding::Encodable + 's, <T as bitcoin_consensus_encoding::Encodable>::Encoder: bitcoin_consensus_encoding::ExactSizeEncoder
impl<'s, T> core::marker::Freeze for bitcoin_consensus_encoding::EncodableByteIter<'s, T> where <T as bitcoin_consensus_encoding::Encodable>::Encoder: core::marker::Freeze
impl<'s, T> core::marker::Send for bitcoin_consensus_encoding::EncodableByteIter<'s, T> where <T as bitcoin_consensus_encoding::Encodable>::Encoder: core::marker::Send
impl<'s, T> core::marker::Sync for bitcoin_consensus_encoding::EncodableByteIter<'s, T> where <T as bitcoin_consensus_encoding::Encodable>::Encoder: core::marker::Sync
@@ -96,6 +98,7 @@ impl<'s, T> core::marker::Unpin for bitcoin_consensus_encoding::EncodableByteIte
impl<'s, T> core::panic::unwind_safe::RefUnwindSafe for bitcoin_consensus_encoding::EncodableByteIter<'s, T> where <T as bitcoin_consensus_encoding::Encodable>::Encoder: core::panic::unwind_safe::RefUnwindSafe
impl<'s, T> core::panic::unwind_safe::UnwindSafe for bitcoin_consensus_encoding::EncodableByteIter<'s, T> where <T as bitcoin_consensus_encoding::Encodable>::Encoder: core::panic::unwind_safe::UnwindSafe
impl<'sl> bitcoin_consensus_encoding::BytesEncoder<'sl>
+impl<'sl> bitcoin_consensus_encoding::ExactSizeEncoder for bitcoin_consensus_encoding::BytesEncoder<'sl>
impl<'sl> core::marker::Freeze for bitcoin_consensus_encoding::BytesEncoder<'sl>
impl<'sl> core::marker::Send for bitcoin_consensus_encoding::BytesEncoder<'sl>
impl<'sl> core::marker::Sync for bitcoin_consensus_encoding::BytesEncoder<'sl>
@@ -105,6 +108,7 @@ impl<'sl> core::panic::unwind_safe::UnwindSafe for bitcoin_consensus_encoding::B
impl<A, B, C, D, E, F> bitcoin_consensus_encoding::Decoder for bitcoin_consensus_encoding::Decoder6<A, B, C, D, E, F> where A: bitcoin_consensus_encoding::Decoder, B: bitcoin_consensus_encoding::Decoder, C: bitcoin_consensus_encoding::Decoder, D: bitcoin_consensus_encoding::Decoder, E: bitcoin_consensus_encoding::Decoder, F: bitcoin_consensus_encoding::Decoder
impl<A, B, C, D, E, F> bitcoin_consensus_encoding::Decoder6<A, B, C, D, E, F> where A: bitcoin_consensus_encoding::Decoder, B: bitcoin_consensus_encoding::Decoder, C: bitcoin_consensus_encoding::Decoder, D: bitcoin_consensus_encoding::Decoder, E: bitcoin_consensus_encoding::Decoder, F: bitcoin_consensus_encoding::Decoder
impl<A, B, C, D, E, F> bitcoin_consensus_encoding::Encoder6<A, B, C, D, E, F>
+impl<A, B, C, D, E, F> bitcoin_consensus_encoding::ExactSizeEncoder for bitcoin_consensus_encoding::Encoder6<A, B, C, D, E, F> where A: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, B: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, C: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, D: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, E: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, F: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder
impl<A, B, C, D, E, F> core::error::Error for bitcoin_consensus_encoding::Decoder6Error<A, B, C, D, E, F> where A: core::error::Error + 'static, B: core::error::Error + 'static, C: core::error::Error + 'static, D: core::error::Error + 'static, E: core::error::Error + 'static, F: core::error::Error + 'static
impl<A, B, C, D, E, F> core::fmt::Display for bitcoin_consensus_encoding::Decoder6Error<A, B, C, D, E, F> where A: core::fmt::Display, B: core::fmt::Display, C: core::fmt::Display, D: core::fmt::Display, E: core::fmt::Display, F: core::fmt::Display
impl<A, B, C, D, E, F> core::marker::Freeze for bitcoin_consensus_encoding::Decoder6<A, B, C, D, E, F> where <A as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze, <B as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze, <C as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze, C: core::marker::Freeze, F: core::marker::Freeze, <D as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze, <E as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze, A: core::marker::Freeze, B: core::marker::Freeze, D: core::marker::Freeze, E: core::marker::Freeze
@@ -129,6 +133,7 @@ impl<A, B, C, D, E, F> core::panic::unwind_safe::UnwindSafe for bitcoin_consensu
impl<A, B, C, D> bitcoin_consensus_encoding::Decoder for bitcoin_consensus_encoding::Decoder4<A, B, C, D> where A: bitcoin_consensus_encoding::Decoder, B: bitcoin_consensus_encoding::Decoder, C: bitcoin_consensus_encoding::Decoder, D: bitcoin_consensus_encoding::Decoder
impl<A, B, C, D> bitcoin_consensus_encoding::Decoder4<A, B, C, D> where A: bitcoin_consensus_encoding::Decoder, B: bitcoin_consensus_encoding::Decoder, C: bitcoin_consensus_encoding::Decoder, D: bitcoin_consensus_encoding::Decoder
impl<A, B, C, D> bitcoin_consensus_encoding::Encoder4<A, B, C, D>
+impl<A, B, C, D> bitcoin_consensus_encoding::ExactSizeEncoder for bitcoin_consensus_encoding::Encoder4<A, B, C, D> where A: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, B: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, C: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, D: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder
impl<A, B, C, D> core::error::Error for bitcoin_consensus_encoding::Decoder4Error<A, B, C, D> where A: core::error::Error + 'static, B: core::error::Error + 'static, C: core::error::Error + 'static, D: core::error::Error + 'static
impl<A, B, C, D> core::fmt::Display for bitcoin_consensus_encoding::Decoder4Error<A, B, C, D> where A: core::fmt::Display, B: core::fmt::Display, C: core::fmt::Display, D: core::fmt::Display
impl<A, B, C, D> core::marker::Freeze for bitcoin_consensus_encoding::Decoder4<A, B, C, D> where <A as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze, <B as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze, A: core::marker::Freeze, B: core::marker::Freeze, C: core::marker::Freeze, D: core::marker::Freeze, <C as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze
@@ -153,6 +158,7 @@ impl<A, B, C, D> core::panic::unwind_safe::UnwindSafe for bitcoin_consensus_enco
impl<A, B, C> bitcoin_consensus_encoding::Decoder for bitcoin_consensus_encoding::Decoder3<A, B, C> where A: bitcoin_consensus_encoding::Decoder, B: bitcoin_consensus_encoding::Decoder, C: bitcoin_consensus_encoding::Decoder
impl<A, B, C> bitcoin_consensus_encoding::Decoder3<A, B, C> where A: bitcoin_consensus_encoding::Decoder, B: bitcoin_consensus_encoding::Decoder, C: bitcoin_consensus_encoding::Decoder
impl<A, B, C> bitcoin_consensus_encoding::Encoder3<A, B, C>
+impl<A, B, C> bitcoin_consensus_encoding::ExactSizeEncoder for bitcoin_consensus_encoding::Encoder3<A, B, C> where A: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, B: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, C: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder
impl<A, B, C> core::error::Error for bitcoin_consensus_encoding::Decoder3Error<A, B, C> where A: core::error::Error + 'static, B: core::error::Error + 'static, C: core::error::Error + 'static
impl<A, B, C> core::fmt::Display for bitcoin_consensus_encoding::Decoder3Error<A, B, C> where A: core::fmt::Display, B: core::fmt::Display, C: core::fmt::Display
impl<A, B, C> core::marker::Freeze for bitcoin_consensus_encoding::Decoder3<A, B, C> where C: core::marker::Freeze, <A as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze, <B as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze, A: core::marker::Freeze, B: core::marker::Freeze
@@ -177,6 +183,7 @@ impl<A, B, C> core::panic::unwind_safe::UnwindSafe for bitcoin_consensus_encodin
impl<A, B> bitcoin_consensus_encoding::Decoder for bitcoin_consensus_encoding::Decoder2<A, B> where A: bitcoin_consensus_encoding::Decoder, B: bitcoin_consensus_encoding::Decoder
impl<A, B> bitcoin_consensus_encoding::Decoder2<A, B> where A: bitcoin_consensus_encoding::Decoder, B: bitcoin_consensus_encoding::Decoder
impl<A, B> bitcoin_consensus_encoding::Encoder2<A, B>
+impl<A, B> bitcoin_consensus_encoding::ExactSizeEncoder for bitcoin_consensus_encoding::Encoder2<A, B> where A: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, B: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder
impl<A, B> core::error::Error for bitcoin_consensus_encoding::Decoder2Error<A, B> where A: core::error::Error + 'static, B: core::error::Error + 'static
impl<A, B> core::fmt::Display for bitcoin_consensus_encoding::Decoder2Error<A, B> where A: core::fmt::Display, B: core::fmt::Display
impl<A, B> core::marker::Freeze for bitcoin_consensus_encoding::Decoder2<A, B> where A: core::marker::Freeze, B: core::marker::Freeze, <A as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze
@@ -257,6 +264,7 @@ impl<const N: usize> bitcoin_consensus_encoding::ArrayDecoder<N>
impl<const N: usize> bitcoin_consensus_encoding::ArrayEncoder<N>
impl<const N: usize> bitcoin_consensus_encoding::Decoder for bitcoin_consensus_encoding::ArrayDecoder<N>
impl<const N: usize> bitcoin_consensus_encoding::Encoder for bitcoin_consensus_encoding::ArrayEncoder<N>
+impl<const N: usize> bitcoin_consensus_encoding::ExactSizeEncoder for bitcoin_consensus_encoding::ArrayEncoder<N>
impl<const N: usize> core::default::Default for bitcoin_consensus_encoding::ArrayDecoder<N>
impl<const N: usize> core::marker::Freeze for bitcoin_consensus_encoding::ArrayDecoder<N>
impl<const N: usize> core::marker::Freeze for bitcoin_consensus_encoding::ArrayEncoder<N>
@@ -314,6 +322,7 @@ pub fn bitcoin_consensus_encoding::ArrayDecoder<N>::push_bytes(&mut self, bytes:
pub fn bitcoin_consensus_encoding::ArrayDecoder<N>::read_limit(&self) -> usize
pub fn bitcoin_consensus_encoding::ArrayEncoder<N>::advance(&mut self) -> bool
pub fn bitcoin_consensus_encoding::ArrayEncoder<N>::current_chunk(&self) -> &[u8]
+pub fn bitcoin_consensus_encoding::ArrayEncoder<N>::len(&self) -> usize
pub fn bitcoin_consensus_encoding::ByteVecDecoder::default() -> Self
pub fn bitcoin_consensus_encoding::ByteVecDecoder::end(self) -> core::result::Result<Self::Output, Self::Error>
pub fn bitcoin_consensus_encoding::ByteVecDecoder::push_bytes(&mut self, bytes: &mut &[u8]) -> core::result::Result<bool, Self::Error>
@@ -325,6 +334,7 @@ pub fn bitcoin_consensus_encoding::ByteVecDecoderError::from(never: core::conver
pub fn bitcoin_consensus_encoding::ByteVecDecoderError::source(&self) -> core::option::Option<&(dyn core::error::Error + 'static)>
pub fn bitcoin_consensus_encoding::BytesEncoder<'_>::advance(&mut self) -> bool
pub fn bitcoin_consensus_encoding::BytesEncoder<'_>::current_chunk(&self) -> &[u8]
+pub fn bitcoin_consensus_encoding::BytesEncoder<'sl>::len(&self) -> usize
pub fn bitcoin_consensus_encoding::CompactSizeDecoder::clone(&self) -> bitcoin_consensus_encoding::CompactSizeDecoder
pub fn bitcoin_consensus_encoding::CompactSizeDecoder::default() -> Self
pub fn bitcoin_consensus_encoding::CompactSizeDecoder::end(self) -> core::result::Result<Self::Output, Self::Error>
@@ -337,6 +347,7 @@ pub fn bitcoin_consensus_encoding::CompactSizeDecoderError::fmt(&self, f: &mut c
pub fn bitcoin_consensus_encoding::CompactSizeDecoderError::source(&self) -> core::option::Option<&(dyn core::error::Error + 'static)>
pub fn bitcoin_consensus_encoding::CompactSizeEncoder::advance(&mut self) -> bool
pub fn bitcoin_consensus_encoding::CompactSizeEncoder::current_chunk(&self) -> &[u8]
+pub fn bitcoin_consensus_encoding::CompactSizeEncoder::len(&self) -> usize
pub fn bitcoin_consensus_encoding::CompactSizeEncoder::new(value: usize) -> Self
pub fn bitcoin_consensus_encoding::Decodable::decoder() -> Self::Decoder
pub fn bitcoin_consensus_encoding::Decoder2<A, B>::end(self) -> core::result::Result<Self::Output, Self::Error>
@@ -371,18 +382,25 @@ pub fn bitcoin_consensus_encoding::Decoder::end(self) -> core::result::Result<Se
pub fn bitcoin_consensus_encoding::Decoder::push_bytes(&mut self, bytes: &mut &[u8]) -> core::result::Result<bool, Self::Error>
pub fn bitcoin_consensus_encoding::Decoder::read_limit(&self) -> usize
pub fn bitcoin_consensus_encoding::Encodable::encoder(&self) -> Self::Encoder
+pub fn bitcoin_consensus_encoding::EncodableByteIter<'s, T>::len(&self) -> usize
pub fn bitcoin_consensus_encoding::EncodableByteIter<'s, T>::new(encodable: &'s T) -> Self
pub fn bitcoin_consensus_encoding::EncodableByteIter<'s, T>::next(&mut self) -> core::option::Option<Self::Item>
pub fn bitcoin_consensus_encoding::Encoder2<A, B>::advance(&mut self) -> bool
pub fn bitcoin_consensus_encoding::Encoder2<A, B>::current_chunk(&self) -> &[u8]
+pub fn bitcoin_consensus_encoding::Encoder2<A, B>::len(&self) -> usize
pub fn bitcoin_consensus_encoding::Encoder3<A, B, C>::advance(&mut self) -> bool
pub fn bitcoin_consensus_encoding::Encoder3<A, B, C>::current_chunk(&self) -> &[u8]
+pub fn bitcoin_consensus_encoding::Encoder3<A, B, C>::len(&self) -> usize
pub fn bitcoin_consensus_encoding::Encoder4<A, B, C, D>::advance(&mut self) -> bool
pub fn bitcoin_consensus_encoding::Encoder4<A, B, C, D>::current_chunk(&self) -> &[u8]
+pub fn bitcoin_consensus_encoding::Encoder4<A, B, C, D>::len(&self) -> usize
pub fn bitcoin_consensus_encoding::Encoder6<A, B, C, D, E, F>::advance(&mut self) -> bool
pub fn bitcoin_consensus_encoding::Encoder6<A, B, C, D, E, F>::current_chunk(&self) -> &[u8]
+pub fn bitcoin_consensus_encoding::Encoder6<A, B, C, D, E, F>::len(&self) -> usize
pub fn bitcoin_consensus_encoding::Encoder::advance(&mut self) -> bool
pub fn bitcoin_consensus_encoding::Encoder::current_chunk(&self) -> &[u8]
+pub fn bitcoin_consensus_encoding::ExactSizeEncoder::is_empty(&self) -> bool
+pub fn bitcoin_consensus_encoding::ExactSizeEncoder::len(&self) -> usize
pub fn bitcoin_consensus_encoding::LengthPrefixExceedsMaxError::clone(&self) -> bitcoin_consensus_encoding::LengthPrefixExceedsMaxError
pub fn bitcoin_consensus_encoding::LengthPrefixExceedsMaxError::eq(&self, other: &bitcoin_consensus_encoding::LengthPrefixExceedsMaxError) -> bool
pub fn bitcoin_consensus_encoding::LengthPrefixExceedsMaxError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
@@ -413,6 +431,7 @@ pub fn bitcoin_consensus_encoding::encode_to_writer<T, W>(object: &T, writer: W)
pub fn core::option::Option<T>::advance(&mut self) -> bool
pub fn core::option::Option<T>::current_chunk(&self) -> &[u8]
pub macro bitcoin_consensus_encoding::encoder_newtype!
+pub macro bitcoin_consensus_encoding::encoder_newtype_exact!
pub mod bitcoin_consensus_encoding
pub struct bitcoin_consensus_encoding::ArrayDecoder<const N: usize>
pub struct bitcoin_consensus_encoding::ArrayEncoder<const N: usize>
@@ -440,6 +459,7 @@ pub trait bitcoin_consensus_encoding::Decodable
pub trait bitcoin_consensus_encoding::Decoder: core::marker::Sized
pub trait bitcoin_consensus_encoding::Encodable
pub trait bitcoin_consensus_encoding::Encoder
+pub trait bitcoin_consensus_encoding::ExactSizeEncoder: bitcoin_consensus_encoding::Encoder
pub type bitcoin_consensus_encoding::ArrayDecoder<N>::Error = bitcoin_consensus_encoding::UnexpectedEofError
pub type bitcoin_consensus_encoding::ArrayDecoder<N>::Output = [u8; N]
pub type bitcoin_consensus_encoding::ByteVecDecoder::Error = bitcoin_consensus_encoding::ByteVecDecoderError
diff --git a/api/consensus_encoding/alloc-only.txt b/api/consensus_encoding/alloc-only.txt
index 1528e3bf..f598237a 100644
--- a/api/consensus_encoding/alloc-only.txt
+++ b/api/consensus_encoding/alloc-only.txt
@@ -5,6 +5,7 @@ impl bitcoin_consensus_encoding::Decoder for bitcoin_consensus_encoding::ByteVec
impl bitcoin_consensus_encoding::Decoder for bitcoin_consensus_encoding::CompactSizeDecoder
impl bitcoin_consensus_encoding::Encoder for bitcoin_consensus_encoding::BytesEncoder<'_>
impl bitcoin_consensus_encoding::Encoder for bitcoin_consensus_encoding::CompactSizeEncoder
+impl bitcoin_consensus_encoding::ExactSizeEncoder for bitcoin_consensus_encoding::CompactSizeEncoder
impl core::clone::Clone for bitcoin_consensus_encoding::ByteVecDecoderError
impl core::clone::Clone for bitcoin_consensus_encoding::CompactSizeDecoder
impl core::clone::Clone for bitcoin_consensus_encoding::CompactSizeDecoderError
@@ -85,6 +86,7 @@ impl<'e, T> core::panic::unwind_safe::RefUnwindSafe for bitcoin_consensus_encodi
impl<'e, T> core::panic::unwind_safe::UnwindSafe for bitcoin_consensus_encoding::SliceEncoder<'e, T> where <T as bitcoin_consensus_encoding::Encodable>::Encoder: core::panic::unwind_safe::UnwindSafe, T: core::panic::unwind_safe::RefUnwindSafe
impl<'s, T: bitcoin_consensus_encoding::Encodable + 's> bitcoin_consensus_encoding::EncodableByteIter<'s, T>
impl<'s, T: bitcoin_consensus_encoding::Encodable + 's> core::iter::traits::iterator::Iterator for bitcoin_consensus_encoding::EncodableByteIter<'s, T>
+impl<'s, T> core::iter::traits::exact_size::ExactSizeIterator for bitcoin_consensus_encoding::EncodableByteIter<'s, T> where T: bitcoin_consensus_encoding::Encodable + 's, <T as bitcoin_consensus_encoding::Encodable>::Encoder: bitcoin_consensus_encoding::ExactSizeEncoder
impl<'s, T> core::marker::Freeze for bitcoin_consensus_encoding::EncodableByteIter<'s, T> where <T as bitcoin_consensus_encoding::Encodable>::Encoder: core::marker::Freeze
impl<'s, T> core::marker::Send for bitcoin_consensus_encoding::EncodableByteIter<'s, T> where <T as bitcoin_consensus_encoding::Encodable>::Encoder: core::marker::Send
impl<'s, T> core::marker::Sync for bitcoin_consensus_encoding::EncodableByteIter<'s, T> where <T as bitcoin_consensus_encoding::Encodable>::Encoder: core::marker::Sync
@@ -92,6 +94,7 @@ impl<'s, T> core::marker::Unpin for bitcoin_consensus_encoding::EncodableByteIte
impl<'s, T> core::panic::unwind_safe::RefUnwindSafe for bitcoin_consensus_encoding::EncodableByteIter<'s, T> where <T as bitcoin_consensus_encoding::Encodable>::Encoder: core::panic::unwind_safe::RefUnwindSafe
impl<'s, T> core::panic::unwind_safe::UnwindSafe for bitcoin_consensus_encoding::EncodableByteIter<'s, T> where <T as bitcoin_consensus_encoding::Encodable>::Encoder: core::panic::unwind_safe::UnwindSafe
impl<'sl> bitcoin_consensus_encoding::BytesEncoder<'sl>
+impl<'sl> bitcoin_consensus_encoding::ExactSizeEncoder for bitcoin_consensus_encoding::BytesEncoder<'sl>
impl<'sl> core::marker::Freeze for bitcoin_consensus_encoding::BytesEncoder<'sl>
impl<'sl> core::marker::Send for bitcoin_consensus_encoding::BytesEncoder<'sl>
impl<'sl> core::marker::Sync for bitcoin_consensus_encoding::BytesEncoder<'sl>
@@ -101,6 +104,7 @@ impl<'sl> core::panic::unwind_safe::UnwindSafe for bitcoin_consensus_encoding::B
impl<A, B, C, D, E, F> bitcoin_consensus_encoding::Decoder for bitcoin_consensus_encoding::Decoder6<A, B, C, D, E, F> where A: bitcoin_consensus_encoding::Decoder, B: bitcoin_consensus_encoding::Decoder, C: bitcoin_consensus_encoding::Decoder, D: bitcoin_consensus_encoding::Decoder, E: bitcoin_consensus_encoding::Decoder, F: bitcoin_consensus_encoding::Decoder
impl<A, B, C, D, E, F> bitcoin_consensus_encoding::Decoder6<A, B, C, D, E, F> where A: bitcoin_consensus_encoding::Decoder, B: bitcoin_consensus_encoding::Decoder, C: bitcoin_consensus_encoding::Decoder, D: bitcoin_consensus_encoding::Decoder, E: bitcoin_consensus_encoding::Decoder, F: bitcoin_consensus_encoding::Decoder
impl<A, B, C, D, E, F> bitcoin_consensus_encoding::Encoder6<A, B, C, D, E, F>
+impl<A, B, C, D, E, F> bitcoin_consensus_encoding::ExactSizeEncoder for bitcoin_consensus_encoding::Encoder6<A, B, C, D, E, F> where A: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, B: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, C: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, D: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, E: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, F: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder
impl<A, B, C, D, E, F> core::fmt::Display for bitcoin_consensus_encoding::Decoder6Error<A, B, C, D, E, F> where A: core::fmt::Display, B: core::fmt::Display, C: core::fmt::Display, D: core::fmt::Display, E: core::fmt::Display, F: core::fmt::Display
impl<A, B, C, D, E, F> core::marker::Freeze for bitcoin_consensus_encoding::Decoder6<A, B, C, D, E, F> where <A as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze, <B as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze, <C as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze, C: core::marker::Freeze, F: core::marker::Freeze, <D as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze, <E as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze, A: core::marker::Freeze, B: core::marker::Freeze, D: core::marker::Freeze, E: core::marker::Freeze
impl<A, B, C, D, E, F> core::marker::Freeze for bitcoin_consensus_encoding::Decoder6Error<A, B, C, D, E, F> where A: core::marker::Freeze, B: core::marker::Freeze, C: core::marker::Freeze, D: core::marker::Freeze, E: core::marker::Freeze, F: core::marker::Freeze
@@ -124,6 +128,7 @@ impl<A, B, C, D, E, F> core::panic::unwind_safe::UnwindSafe for bitcoin_consensu
impl<A, B, C, D> bitcoin_consensus_encoding::Decoder for bitcoin_consensus_encoding::Decoder4<A, B, C, D> where A: bitcoin_consensus_encoding::Decoder, B: bitcoin_consensus_encoding::Decoder, C: bitcoin_consensus_encoding::Decoder, D: bitcoin_consensus_encoding::Decoder
impl<A, B, C, D> bitcoin_consensus_encoding::Decoder4<A, B, C, D> where A: bitcoin_consensus_encoding::Decoder, B: bitcoin_consensus_encoding::Decoder, C: bitcoin_consensus_encoding::Decoder, D: bitcoin_consensus_encoding::Decoder
impl<A, B, C, D> bitcoin_consensus_encoding::Encoder4<A, B, C, D>
+impl<A, B, C, D> bitcoin_consensus_encoding::ExactSizeEncoder for bitcoin_consensus_encoding::Encoder4<A, B, C, D> where A: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, B: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, C: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, D: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder
impl<A, B, C, D> core::fmt::Display for bitcoin_consensus_encoding::Decoder4Error<A, B, C, D> where A: core::fmt::Display, B: core::fmt::Display, C: core::fmt::Display, D: core::fmt::Display
impl<A, B, C, D> core::marker::Freeze for bitcoin_consensus_encoding::Decoder4<A, B, C, D> where <A as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze, <B as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze, A: core::marker::Freeze, B: core::marker::Freeze, C: core::marker::Freeze, D: core::marker::Freeze, <C as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze
impl<A, B, C, D> core::marker::Freeze for bitcoin_consensus_encoding::Decoder4Error<A, B, C, D> where A: core::marker::Freeze, B: core::marker::Freeze, C: core::marker::Freeze, D: core::marker::Freeze
@@ -147,6 +152,7 @@ impl<A, B, C, D> core::panic::unwind_safe::UnwindSafe for bitcoin_consensus_enco
impl<A, B, C> bitcoin_consensus_encoding::Decoder for bitcoin_consensus_encoding::Decoder3<A, B, C> where A: bitcoin_consensus_encoding::Decoder, B: bitcoin_consensus_encoding::Decoder, C: bitcoin_consensus_encoding::Decoder
impl<A, B, C> bitcoin_consensus_encoding::Decoder3<A, B, C> where A: bitcoin_consensus_encoding::Decoder, B: bitcoin_consensus_encoding::Decoder, C: bitcoin_consensus_encoding::Decoder
impl<A, B, C> bitcoin_consensus_encoding::Encoder3<A, B, C>
+impl<A, B, C> bitcoin_consensus_encoding::ExactSizeEncoder for bitcoin_consensus_encoding::Encoder3<A, B, C> where A: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, B: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, C: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder
impl<A, B, C> core::fmt::Display for bitcoin_consensus_encoding::Decoder3Error<A, B, C> where A: core::fmt::Display, B: core::fmt::Display, C: core::fmt::Display
impl<A, B, C> core::marker::Freeze for bitcoin_consensus_encoding::Decoder3<A, B, C> where C: core::marker::Freeze, <A as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze, <B as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze, A: core::marker::Freeze, B: core::marker::Freeze
impl<A, B, C> core::marker::Freeze for bitcoin_consensus_encoding::Decoder3Error<A, B, C> where A: core::marker::Freeze, B: core::marker::Freeze, C: core::marker::Freeze
@@ -170,6 +176,7 @@ impl<A, B, C> core::panic::unwind_safe::UnwindSafe for bitcoin_consensus_encodin
impl<A, B> bitcoin_consensus_encoding::Decoder for bitcoin_consensus_encoding::Decoder2<A, B> where A: bitcoin_consensus_encoding::Decoder, B: bitcoin_consensus_encoding::Decoder
impl<A, B> bitcoin_consensus_encoding::Decoder2<A, B> where A: bitcoin_consensus_encoding::Decoder, B: bitcoin_consensus_encoding::Decoder
impl<A, B> bitcoin_consensus_encoding::Encoder2<A, B>
+impl<A, B> bitcoin_consensus_encoding::ExactSizeEncoder for bitcoin_consensus_encoding::Encoder2<A, B> where A: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, B: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder
impl<A, B> core::fmt::Display for bitcoin_consensus_encoding::Decoder2Error<A, B> where A: core::fmt::Display, B: core::fmt::Display
impl<A, B> core::marker::Freeze for bitcoin_consensus_encoding::Decoder2<A, B> where A: core::marker::Freeze, B: core::marker::Freeze, <A as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze
impl<A, B> core::marker::Freeze for bitcoin_consensus_encoding::Decoder2Error<A, B> where A: core::marker::Freeze, B: core::marker::Freeze
@@ -238,6 +245,7 @@ impl<const N: usize> bitcoin_consensus_encoding::ArrayDecoder<N>
impl<const N: usize> bitcoin_consensus_encoding::ArrayEncoder<N>
impl<const N: usize> bitcoin_consensus_encoding::Decoder for bitcoin_consensus_encoding::ArrayDecoder<N>
impl<const N: usize> bitcoin_consensus_encoding::Encoder for bitcoin_consensus_encoding::ArrayEncoder<N>
+impl<const N: usize> bitcoin_consensus_encoding::ExactSizeEncoder for bitcoin_consensus_encoding::ArrayEncoder<N>
impl<const N: usize> core::default::Default for bitcoin_consensus_encoding::ArrayDecoder<N>
impl<const N: usize> core::marker::Freeze for bitcoin_consensus_encoding::ArrayDecoder<N>
impl<const N: usize> core::marker::Freeze for bitcoin_consensus_encoding::ArrayEncoder<N>
@@ -292,6 +300,7 @@ pub fn bitcoin_consensus_encoding::ArrayDecoder<N>::push_bytes(&mut self, bytes:
pub fn bitcoin_consensus_encoding::ArrayDecoder<N>::read_limit(&self) -> usize
pub fn bitcoin_consensus_encoding::ArrayEncoder<N>::advance(&mut self) -> bool
pub fn bitcoin_consensus_encoding::ArrayEncoder<N>::current_chunk(&self) -> &[u8]
+pub fn bitcoin_consensus_encoding::ArrayEncoder<N>::len(&self) -> usize
pub fn bitcoin_consensus_encoding::ByteVecDecoder::default() -> Self
pub fn bitcoin_consensus_encoding::ByteVecDecoder::end(self) -> core::result::Result<Self::Output, Self::Error>
pub fn bitcoin_consensus_encoding::ByteVecDecoder::push_bytes(&mut self, bytes: &mut &[u8]) -> core::result::Result<bool, Self::Error>
@@ -302,6 +311,7 @@ pub fn bitcoin_consensus_encoding::ByteVecDecoderError::fmt(&self, f: &mut core:
pub fn bitcoin_consensus_encoding::ByteVecDecoderError::from(never: core::convert::Infallible) -> Self
pub fn bitcoin_consensus_encoding::BytesEncoder<'_>::advance(&mut self) -> bool
pub fn bitcoin_consensus_encoding::BytesEncoder<'_>::current_chunk(&self) -> &[u8]
+pub fn bitcoin_consensus_encoding::BytesEncoder<'sl>::len(&self) -> usize
pub fn bitcoin_consensus_encoding::CompactSizeDecoder::clone(&self) -> bitcoin_consensus_encoding::CompactSizeDecoder
pub fn bitcoin_consensus_encoding::CompactSizeDecoder::default() -> Self
pub fn bitcoin_consensus_encoding::CompactSizeDecoder::end(self) -> core::result::Result<Self::Output, Self::Error>
@@ -313,6 +323,7 @@ pub fn bitcoin_consensus_encoding::CompactSizeDecoderError::eq(&self, other: &bi
pub fn bitcoin_consensus_encoding::CompactSizeDecoderError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
pub fn bitcoin_consensus_encoding::CompactSizeEncoder::advance(&mut self) -> bool
pub fn bitcoin_consensus_encoding::CompactSizeEncoder::current_chunk(&self) -> &[u8]
+pub fn bitcoin_consensus_encoding::CompactSizeEncoder::len(&self) -> usize
pub fn bitcoin_consensus_encoding::CompactSizeEncoder::new(value: usize) -> Self
pub fn bitcoin_consensus_encoding::Decodable::decoder() -> Self::Decoder
pub fn bitcoin_consensus_encoding::Decoder2<A, B>::end(self) -> core::result::Result<Self::Output, Self::Error>
@@ -343,18 +354,25 @@ pub fn bitcoin_consensus_encoding::Decoder::end(self) -> core::result::Result<Se
pub fn bitcoin_consensus_encoding::Decoder::push_bytes(&mut self, bytes: &mut &[u8]) -> core::result::Result<bool, Self::Error>
pub fn bitcoin_consensus_encoding::Decoder::read_limit(&self) -> usize
pub fn bitcoin_consensus_encoding::Encodable::encoder(&self) -> Self::Encoder
+pub fn bitcoin_consensus_encoding::EncodableByteIter<'s, T>::len(&self) -> usize
pub fn bitcoin_consensus_encoding::EncodableByteIter<'s, T>::new(encodable: &'s T) -> Self
pub fn bitcoin_consensus_encoding::EncodableByteIter<'s, T>::next(&mut self) -> core::option::Option<Self::Item>
pub fn bitcoin_consensus_encoding::Encoder2<A, B>::advance(&mut self) -> bool
pub fn bitcoin_consensus_encoding::Encoder2<A, B>::current_chunk(&self) -> &[u8]
+pub fn bitcoin_consensus_encoding::Encoder2<A, B>::len(&self) -> usize
pub fn bitcoin_consensus_encoding::Encoder3<A, B, C>::advance(&mut self) -> bool
pub fn bitcoin_consensus_encoding::Encoder3<A, B, C>::current_chunk(&self) -> &[u8]
+pub fn bitcoin_consensus_encoding::Encoder3<A, B, C>::len(&self) -> usize
pub fn bitcoin_consensus_encoding::Encoder4<A, B, C, D>::advance(&mut self) -> bool
pub fn bitcoin_consensus_encoding::Encoder4<A, B, C, D>::current_chunk(&self) -> &[u8]
+pub fn bitcoin_consensus_encoding::Encoder4<A, B, C, D>::len(&self) -> usize
pub fn bitcoin_consensus_encoding::Encoder6<A, B, C, D, E, F>::advance(&mut self) -> bool
pub fn bitcoin_consensus_encoding::Encoder6<A, B, C, D, E, F>::current_chunk(&self) -> &[u8]
+pub fn bitcoin_consensus_encoding::Encoder6<A, B, C, D, E, F>::len(&self) -> usize
pub fn bitcoin_consensus_encoding::Encoder::advance(&mut self) -> bool
pub fn bitcoin_consensus_encoding::Encoder::current_chunk(&self) -> &[u8]
+pub fn bitcoin_consensus_encoding::ExactSizeEncoder::is_empty(&self) -> bool
+pub fn bitcoin_consensus_encoding::ExactSizeEncoder::len(&self) -> usize
pub fn bitcoin_consensus_encoding::LengthPrefixExceedsMaxError::clone(&self) -> bitcoin_consensus_encoding::LengthPrefixExceedsMaxError
pub fn bitcoin_consensus_encoding::LengthPrefixExceedsMaxError::eq(&self, other: &bitcoin_consensus_encoding::LengthPrefixExceedsMaxError) -> bool
pub fn bitcoin_consensus_encoding::LengthPrefixExceedsMaxError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
@@ -377,6 +395,7 @@ pub fn bitcoin_consensus_encoding::encode_to_vec<T>(object: &T) -> alloc::vec::V
pub fn core::option::Option<T>::advance(&mut self) -> bool
pub fn core::option::Option<T>::current_chunk(&self) -> &[u8]
pub macro bitcoin_consensus_encoding::encoder_newtype!
+pub macro bitcoin_consensus_encoding::encoder_newtype_exact!
pub mod bitcoin_consensus_encoding
pub struct bitcoin_consensus_encoding::ArrayDecoder<const N: usize>
pub struct bitcoin_consensus_encoding::ArrayEncoder<const N: usize>
@@ -404,6 +423,7 @@ pub trait bitcoin_consensus_encoding::Decodable
pub trait bitcoin_consensus_encoding::Decoder: core::marker::Sized
pub trait bitcoin_consensus_encoding::Encodable
pub trait bitcoin_consensus_encoding::Encoder
+pub trait bitcoin_consensus_encoding::ExactSizeEncoder: bitcoin_consensus_encoding::Encoder
pub type bitcoin_consensus_encoding::ArrayDecoder<N>::Error = bitcoin_consensus_encoding::UnexpectedEofError
pub type bitcoin_consensus_encoding::ArrayDecoder<N>::Output = [u8; N]
pub type bitcoin_consensus_encoding::ByteVecDecoder::Error = bitcoin_consensus_encoding::ByteVecDecoderError
diff --git a/api/consensus_encoding/no-features.txt b/api/consensus_encoding/no-features.txt
index 253aaa7f..99fb65ac 100644
--- a/api/consensus_encoding/no-features.txt
+++ b/api/consensus_encoding/no-features.txt
@@ -3,6 +3,7 @@ impl bitcoin_consensus_encoding::CompactSizeEncoder
impl bitcoin_consensus_encoding::Decoder for bitcoin_consensus_encoding::CompactSizeDecoder
impl bitcoin_consensus_encoding::Encoder for bitcoin_consensus_encoding::BytesEncoder<'_>
impl bitcoin_consensus_encoding::Encoder for bitcoin_consensus_encoding::CompactSizeEncoder
+impl bitcoin_consensus_encoding::ExactSizeEncoder for bitcoin_consensus_encoding::CompactSizeEncoder
impl core::clone::Clone for bitcoin_consensus_encoding::CompactSizeDecoder
impl core::clone::Clone for bitcoin_consensus_encoding::CompactSizeDecoderError
impl core::clone::Clone for bitcoin_consensus_encoding::UnexpectedEofError
@@ -51,6 +52,7 @@ impl<'e, T> core::panic::unwind_safe::RefUnwindSafe for bitcoin_consensus_encodi
impl<'e, T> core::panic::unwind_safe::UnwindSafe for bitcoin_consensus_encoding::SliceEncoder<'e, T> where <T as bitcoin_consensus_encoding::Encodable>::Encoder: core::panic::unwind_safe::UnwindSafe, T: core::panic::unwind_safe::RefUnwindSafe
impl<'s, T: bitcoin_consensus_encoding::Encodable + 's> bitcoin_consensus_encoding::EncodableByteIter<'s, T>
impl<'s, T: bitcoin_consensus_encoding::Encodable + 's> core::iter::traits::iterator::Iterator for bitcoin_consensus_encoding::EncodableByteIter<'s, T>
+impl<'s, T> core::iter::traits::exact_size::ExactSizeIterator for bitcoin_consensus_encoding::EncodableByteIter<'s, T> where T: bitcoin_consensus_encoding::Encodable + 's, <T as bitcoin_consensus_encoding::Encodable>::Encoder: bitcoin_consensus_encoding::ExactSizeEncoder
impl<'s, T> core::marker::Freeze for bitcoin_consensus_encoding::EncodableByteIter<'s, T> where <T as bitcoin_consensus_encoding::Encodable>::Encoder: core::marker::Freeze
impl<'s, T> core::marker::Send for bitcoin_consensus_encoding::EncodableByteIter<'s, T> where <T as bitcoin_consensus_encoding::Encodable>::Encoder: core::marker::Send
impl<'s, T> core::marker::Sync for bitcoin_consensus_encoding::EncodableByteIter<'s, T> where <T as bitcoin_consensus_encoding::Encodable>::Encoder: core::marker::Sync
@@ -58,6 +60,7 @@ impl<'s, T> core::marker::Unpin for bitcoin_consensus_encoding::EncodableByteIte
impl<'s, T> core::panic::unwind_safe::RefUnwindSafe for bitcoin_consensus_encoding::EncodableByteIter<'s, T> where <T as bitcoin_consensus_encoding::Encodable>::Encoder: core::panic::unwind_safe::RefUnwindSafe
impl<'s, T> core::panic::unwind_safe::UnwindSafe for bitcoin_consensus_encoding::EncodableByteIter<'s, T> where <T as bitcoin_consensus_encoding::Encodable>::Encoder: core::panic::unwind_safe::UnwindSafe
impl<'sl> bitcoin_consensus_encoding::BytesEncoder<'sl>
+impl<'sl> bitcoin_consensus_encoding::ExactSizeEncoder for bitcoin_consensus_encoding::BytesEncoder<'sl>
impl<'sl> core::marker::Freeze for bitcoin_consensus_encoding::BytesEncoder<'sl>
impl<'sl> core::marker::Send for bitcoin_consensus_encoding::BytesEncoder<'sl>
impl<'sl> core::marker::Sync for bitcoin_consensus_encoding::BytesEncoder<'sl>
@@ -67,6 +70,7 @@ impl<'sl> core::panic::unwind_safe::UnwindSafe for bitcoin_consensus_encoding::B
impl<A, B, C, D, E, F> bitcoin_consensus_encoding::Decoder for bitcoin_consensus_encoding::Decoder6<A, B, C, D, E, F> where A: bitcoin_consensus_encoding::Decoder, B: bitcoin_consensus_encoding::Decoder, C: bitcoin_consensus_encoding::Decoder, D: bitcoin_consensus_encoding::Decoder, E: bitcoin_consensus_encoding::Decoder, F: bitcoin_consensus_encoding::Decoder
impl<A, B, C, D, E, F> bitcoin_consensus_encoding::Decoder6<A, B, C, D, E, F> where A: bitcoin_consensus_encoding::Decoder, B: bitcoin_consensus_encoding::Decoder, C: bitcoin_consensus_encoding::Decoder, D: bitcoin_consensus_encoding::Decoder, E: bitcoin_consensus_encoding::Decoder, F: bitcoin_consensus_encoding::Decoder
impl<A, B, C, D, E, F> bitcoin_consensus_encoding::Encoder6<A, B, C, D, E, F>
+impl<A, B, C, D, E, F> bitcoin_consensus_encoding::ExactSizeEncoder for bitcoin_consensus_encoding::Encoder6<A, B, C, D, E, F> where A: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, B: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, C: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, D: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, E: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, F: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder
impl<A, B, C, D, E, F> core::fmt::Display for bitcoin_consensus_encoding::Decoder6Error<A, B, C, D, E, F> where A: core::fmt::Display, B: core::fmt::Display, C: core::fmt::Display, D: core::fmt::Display, E: core::fmt::Display, F: core::fmt::Display
impl<A, B, C, D, E, F> core::marker::Freeze for bitcoin_consensus_encoding::Decoder6<A, B, C, D, E, F> where <A as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze, <B as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze, <C as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze, C: core::marker::Freeze, F: core::marker::Freeze, <D as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze, <E as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze, A: core::marker::Freeze, B: core::marker::Freeze, D: core::marker::Freeze, E: core::marker::Freeze
impl<A, B, C, D, E, F> core::marker::Freeze for bitcoin_consensus_encoding::Decoder6Error<A, B, C, D, E, F> where A: core::marker::Freeze, B: core::marker::Freeze, C: core::marker::Freeze, D: core::marker::Freeze, E: core::marker::Freeze, F: core::marker::Freeze
@@ -90,6 +94,7 @@ impl<A, B, C, D, E, F> core::panic::unwind_safe::UnwindSafe for bitcoin_consensu
impl<A, B, C, D> bitcoin_consensus_encoding::Decoder for bitcoin_consensus_encoding::Decoder4<A, B, C, D> where A: bitcoin_consensus_encoding::Decoder, B: bitcoin_consensus_encoding::Decoder, C: bitcoin_consensus_encoding::Decoder, D: bitcoin_consensus_encoding::Decoder
impl<A, B, C, D> bitcoin_consensus_encoding::Decoder4<A, B, C, D> where A: bitcoin_consensus_encoding::Decoder, B: bitcoin_consensus_encoding::Decoder, C: bitcoin_consensus_encoding::Decoder, D: bitcoin_consensus_encoding::Decoder
impl<A, B, C, D> bitcoin_consensus_encoding::Encoder4<A, B, C, D>
+impl<A, B, C, D> bitcoin_consensus_encoding::ExactSizeEncoder for bitcoin_consensus_encoding::Encoder4<A, B, C, D> where A: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, B: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, C: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, D: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder
impl<A, B, C, D> core::fmt::Display for bitcoin_consensus_encoding::Decoder4Error<A, B, C, D> where A: core::fmt::Display, B: core::fmt::Display, C: core::fmt::Display, D: core::fmt::Display
impl<A, B, C, D> core::marker::Freeze for bitcoin_consensus_encoding::Decoder4<A, B, C, D> where <A as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze, <B as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze, A: core::marker::Freeze, B: core::marker::Freeze, C: core::marker::Freeze, D: core::marker::Freeze, <C as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze
impl<A, B, C, D> core::marker::Freeze for bitcoin_consensus_encoding::Decoder4Error<A, B, C, D> where A: core::marker::Freeze, B: core::marker::Freeze, C: core::marker::Freeze, D: core::marker::Freeze
@@ -113,6 +118,7 @@ impl<A, B, C, D> core::panic::unwind_safe::UnwindSafe for bitcoin_consensus_enco
impl<A, B, C> bitcoin_consensus_encoding::Decoder for bitcoin_consensus_encoding::Decoder3<A, B, C> where A: bitcoin_consensus_encoding::Decoder, B: bitcoin_consensus_encoding::Decoder, C: bitcoin_consensus_encoding::Decoder
impl<A, B, C> bitcoin_consensus_encoding::Decoder3<A, B, C> where A: bitcoin_consensus_encoding::Decoder, B: bitcoin_consensus_encoding::Decoder, C: bitcoin_consensus_encoding::Decoder
impl<A, B, C> bitcoin_consensus_encoding::Encoder3<A, B, C>
+impl<A, B, C> bitcoin_consensus_encoding::ExactSizeEncoder for bitcoin_consensus_encoding::Encoder3<A, B, C> where A: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, B: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, C: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder
impl<A, B, C> core::fmt::Display for bitcoin_consensus_encoding::Decoder3Error<A, B, C> where A: core::fmt::Display, B: core::fmt::Display, C: core::fmt::Display
impl<A, B, C> core::marker::Freeze for bitcoin_consensus_encoding::Decoder3<A, B, C> where C: core::marker::Freeze, <A as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze, <B as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze, A: core::marker::Freeze, B: core::marker::Freeze
impl<A, B, C> core::marker::Freeze for bitcoin_consensus_encoding::Decoder3Error<A, B, C> where A: core::marker::Freeze, B: core::marker::Freeze, C: core::marker::Freeze
@@ -136,6 +142,7 @@ impl<A, B, C> core::panic::unwind_safe::UnwindSafe for bitcoin_consensus_encodin
impl<A, B> bitcoin_consensus_encoding::Decoder for bitcoin_consensus_encoding::Decoder2<A, B> where A: bitcoin_consensus_encoding::Decoder, B: bitcoin_consensus_encoding::Decoder
impl<A, B> bitcoin_consensus_encoding::Decoder2<A, B> where A: bitcoin_consensus_encoding::Decoder, B: bitcoin_consensus_encoding::Decoder
impl<A, B> bitcoin_consensus_encoding::Encoder2<A, B>
+impl<A, B> bitcoin_consensus_encoding::ExactSizeEncoder for bitcoin_consensus_encoding::Encoder2<A, B> where A: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder, B: bitcoin_consensus_encoding::Encoder + bitcoin_consensus_encoding::ExactSizeEncoder
impl<A, B> core::fmt::Display for bitcoin_consensus_encoding::Decoder2Error<A, B> where A: core::fmt::Display, B: core::fmt::Display
impl<A, B> core::marker::Freeze for bitcoin_consensus_encoding::Decoder2<A, B> where A: core::marker::Freeze, B: core::marker::Freeze, <A as bitcoin_consensus_encoding::Decoder>::Output: core::marker::Freeze
impl<A, B> core::marker::Freeze for bitcoin_consensus_encoding::Decoder2Error<A, B> where A: core::marker::Freeze, B: core::marker::Freeze
@@ -182,6 +189,7 @@ impl<const N: usize> bitcoin_consensus_encoding::ArrayDecoder<N>
impl<const N: usize> bitcoin_consensus_encoding::ArrayEncoder<N>
impl<const N: usize> bitcoin_consensus_encoding::Decoder for bitcoin_consensus_encoding::ArrayDecoder<N>
impl<const N: usize> bitcoin_consensus_encoding::Encoder for bitcoin_consensus_encoding::ArrayEncoder<N>
+impl<const N: usize> bitcoin_consensus_encoding::ExactSizeEncoder for bitcoin_consensus_encoding::ArrayEncoder<N>
impl<const N: usize> core::default::Default for bitcoin_consensus_encoding::ArrayDecoder<N>
impl<const N: usize> core::marker::Freeze for bitcoin_consensus_encoding::ArrayDecoder<N>
impl<const N: usize> core::marker::Freeze for bitcoin_consensus_encoding::ArrayEncoder<N>
@@ -234,8 +242,10 @@ pub fn bitcoin_consensus_encoding::ArrayDecoder<N>::push_bytes(&mut self, bytes:
pub fn bitcoin_consensus_encoding::ArrayDecoder<N>::read_limit(&self) -> usize
pub fn bitcoin_consensus_encoding::ArrayEncoder<N>::advance(&mut self) -> bool
pub fn bitcoin_consensus_encoding::ArrayEncoder<N>::current_chunk(&self) -> &[u8]
+pub fn bitcoin_consensus_encoding::ArrayEncoder<N>::len(&self) -> usize
pub fn bitcoin_consensus_encoding::BytesEncoder<'_>::advance(&mut self) -> bool
pub fn bitcoin_consensus_encoding::BytesEncoder<'_>::current_chunk(&self) -> &[u8]
+pub fn bitcoin_consensus_encoding::BytesEncoder<'sl>::len(&self) -> usize
pub fn bitcoin_consensus_encoding::CompactSizeDecoder::clone(&self) -> bitcoin_consensus_encoding::CompactSizeDecoder
pub fn bitcoin_consensus_encoding::CompactSizeDecoder::default() -> Self
pub fn bitcoin_consensus_encoding::CompactSizeDecoder::end(self) -> core::result::Result<Self::Output, Self::Error>
@@ -247,6 +257,7 @@ pub fn bitcoin_consensus_encoding::CompactSizeDecoderError::eq(&self, other: &bi
pub fn bitcoin_consensus_encoding::CompactSizeDecoderError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
pub fn bitcoin_consensus_encoding::CompactSizeEncoder::advance(&mut self) -> bool
pub fn bitcoin_consensus_encoding::CompactSizeEncoder::current_chunk(&self) -> &[u8]
+pub fn bitcoin_consensus_encoding::CompactSizeEncoder::len(&self) -> usize
pub fn bitcoin_consensus_encoding::CompactSizeEncoder::new(value: usize) -> Self
pub fn bitcoin_consensus_encoding::Decodable::decoder() -> Self::Decoder
pub fn bitcoin_consensus_encoding::Decoder2<A, B>::end(self) -> core::result::Result<Self::Output, Self::Error>
@@ -277,18 +288,25 @@ pub fn bitcoin_consensus_encoding::Decoder::end(self) -> core::result::Result<Se
pub fn bitcoin_consensus_encoding::Decoder::push_bytes(&mut self, bytes: &mut &[u8]) -> core::result::Result<bool, Self::Error>
pub fn bitcoin_consensus_encoding::Decoder::read_limit(&self) -> usize
pub fn bitcoin_consensus_encoding::Encodable::encoder(&self) -> Self::Encoder
+pub fn bitcoin_consensus_encoding::EncodableByteIter<'s, T>::len(&self) -> usize
pub fn bitcoin_consensus_encoding::EncodableByteIter<'s, T>::new(encodable: &'s T) -> Self
pub fn bitcoin_consensus_encoding::EncodableByteIter<'s, T>::next(&mut self) -> core::option::Option<Self::Item>
pub fn bitcoin_consensus_encoding::Encoder2<A, B>::advance(&mut self) -> bool
pub fn bitcoin_consensus_encoding::Encoder2<A, B>::current_chunk(&self) -> &[u8]
+pub fn bitcoin_consensus_encoding::Encoder2<A, B>::len(&self) -> usize
pub fn bitcoin_consensus_encoding::Encoder3<A, B, C>::advance(&mut self) -> bool
pub fn bitcoin_consensus_encoding::Encoder3<A, B, C>::current_chunk(&self) -> &[u8]
+pub fn bitcoin_consensus_encoding::Encoder3<A, B, C>::len(&self) -> usize
pub fn bitcoin_consensus_encoding::Encoder4<A, B, C, D>::advance(&mut self) -> bool
pub fn bitcoin_consensus_encoding::Encoder4<A, B, C, D>::current_chunk(&self) -> &[u8]
+pub fn bitcoin_consensus_encoding::Encoder4<A, B, C, D>::len(&self) -> usize
pub fn bitcoin_consensus_encoding::Encoder6<A, B, C, D, E, F>::advance(&mut self) -> bool
pub fn bitcoin_consensus_encoding::Encoder6<A, B, C, D, E, F>::current_chunk(&self) -> &[u8]
+pub fn bitcoin_consensus_encoding::Encoder6<A, B, C, D, E, F>::len(&self) -> usize
pub fn bitcoin_consensus_encoding::Encoder::advance(&mut self) -> bool
pub fn bitcoin_consensus_encoding::Encoder::current_chunk(&self) -> &[u8]
+pub fn bitcoin_consensus_encoding::ExactSizeEncoder::is_empty(&self) -> bool
+pub fn bitcoin_consensus_encoding::ExactSizeEncoder::len(&self) -> usize
pub fn bitcoin_consensus_encoding::SliceEncoder<'_, T>::advance(&mut self) -> bool
pub fn bitcoin_consensus_encoding::SliceEncoder<'_, T>::current_chunk(&self) -> &[u8]
pub fn bitcoin_consensus_encoding::SliceEncoder<'e, T>::without_length_prefix(sl: &'e [T]) -> Self
@@ -299,6 +317,7 @@ pub fn bitcoin_consensus_encoding::decode_from_slice<T>(bytes: &[u8]) -> core::r
pub fn core::option::Option<T>::advance(&mut self) -> bool
pub fn core::option::Option<T>::current_chunk(&self) -> &[u8]
pub macro bitcoin_consensus_encoding::encoder_newtype!
+pub macro bitcoin_consensus_encoding::encoder_newtype_exact!
pub mod bitcoin_consensus_encoding
pub struct bitcoin_consensus_encoding::ArrayDecoder<const N: usize>
pub struct bitcoin_consensus_encoding::ArrayEncoder<const N: usize>
@@ -321,6 +340,7 @@ pub trait bitcoin_consensus_encoding::Decodable
pub trait bitcoin_consensus_encoding::Decoder: core::marker::Sized
pub trait bitcoin_consensus_encoding::Encodable
pub trait bitcoin_consensus_encoding::Encoder
+pub trait bitcoin_consensus_encoding::ExactSizeEncoder: bitcoin_consensus_encoding::Encoder
pub type bitcoin_consensus_encoding::ArrayDecoder<N>::Error = bitcoin_consensus_encoding::UnexpectedEofError
pub type bitcoin_consensus_encoding::ArrayDecoder<N>::Output = [u8; N]
pub type bitcoin_consensus_encoding::CompactSizeDecoder::Error = bitcoin_consensus_encoding::CompactSizeDecoderError
diff --git a/api/primitives/all-features.txt b/api/primitives/all-features.txt
index c1361632..09e8174a 100644
--- a/api/primitives/all-features.txt
+++ b/api/primitives/all-features.txt
@@ -48,6 +48,12 @@ impl bitcoin_consensus_encoding::encode::Encoder for bitcoin_primitives::pow::Co
impl bitcoin_consensus_encoding::encode::Encoder for bitcoin_primitives::transaction::VersionEncoder
impl bitcoin_consensus_encoding::encode::Encoder for bitcoin_primitives::transaction::WitnessesEncoder<'_>
impl bitcoin_consensus_encoding::encode::Encoder for bitcoin_primitives::witness::WitnessEncoder<'_>
+impl bitcoin_consensus_encoding::encode::ExactSizeEncoder for bitcoin_primitives::block::BlockHashEncoder
+impl bitcoin_consensus_encoding::encode::ExactSizeEncoder for bitcoin_primitives::block::HeaderEncoder
+impl bitcoin_consensus_encoding::encode::ExactSizeEncoder for bitcoin_primitives::block::VersionEncoder
+impl bitcoin_consensus_encoding::encode::ExactSizeEncoder for bitcoin_primitives::merkle_tree::TxMerkleNodeEncoder
+impl bitcoin_consensus_encoding::encode::ExactSizeEncoder for bitcoin_primitives::pow::CompactTargetEncoder
+impl bitcoin_consensus_encoding::encode::ExactSizeEncoder for bitcoin_primitives::transaction::VersionEncoder
impl bitcoin_primitives::BlockHash
impl bitcoin_primitives::Ntxid
impl bitcoin_primitives::TxMerkleNode
@@ -1022,6 +1028,8 @@ impl<'e> bitcoin_consensus_encoding::encode::Encoder for bitcoin_primitives::tra
impl<'e> bitcoin_consensus_encoding::encode::Encoder for bitcoin_primitives::transaction::TransactionEncoder<'e>
impl<'e> bitcoin_consensus_encoding::encode::Encoder for bitcoin_primitives::transaction::TxInEncoder<'e>
impl<'e> bitcoin_consensus_encoding::encode::Encoder for bitcoin_primitives::transaction::TxOutEncoder<'e>
+impl<'e> bitcoin_consensus_encoding::encode::ExactSizeEncoder for bitcoin_primitives::script::ScriptEncoder<'e>
+impl<'e> bitcoin_consensus_encoding::encode::ExactSizeEncoder for bitcoin_primitives::transaction::OutPointEncoder<'e>
impl<'e> bitcoin_primitives::transaction::WitnessesEncoder<'e>
impl<'e> core::marker::Freeze for bitcoin_primitives::block::BlockEncoder<'e>
impl<'e> core::marker::Freeze for bitcoin_primitives::script::ScriptEncoder<'e>
@@ -1494,6 +1502,7 @@ pub fn bitcoin_primitives::block::BlockHashDecoderError::from(never: core::conve
pub fn bitcoin_primitives::block::BlockHashDecoderError::source(&self) -> core::option::Option<&(dyn core::error::Error + 'static)>
pub fn bitcoin_primitives::block::BlockHashEncoder::advance(&mut self) -> bool
pub fn bitcoin_primitives::block::BlockHashEncoder::current_chunk(&self) -> &[u8]
+pub fn bitcoin_primitives::block::BlockHashEncoder::len(&self) -> usize
pub fn bitcoin_primitives::block::Checked::clone(&self) -> bitcoin_primitives::block::Checked
pub fn bitcoin_primitives::block::Checked::cmp(&self, other: &bitcoin_primitives::block::Checked) -> core::cmp::Ordering
pub fn bitcoin_primitives::block::Checked::eq(&self, other: &bitcoin_primitives::block::Checked) -> bool
@@ -1521,6 +1530,7 @@ pub fn bitcoin_primitives::block::HeaderDecoderError::from(never: core::convert:
pub fn bitcoin_primitives::block::HeaderDecoderError::source(&self) -> core::option::Option<&(dyn core::error::Error + 'static)>
pub fn bitcoin_primitives::block::HeaderEncoder::advance(&mut self) -> bool
pub fn bitcoin_primitives::block::HeaderEncoder::current_chunk(&self) -> &[u8]
+pub fn bitcoin_primitives::block::HeaderEncoder::len(&self) -> usize
pub fn bitcoin_primitives::block::InvalidBlockError::clone(&self) -> bitcoin_primitives::block::InvalidBlockError
pub fn bitcoin_primitives::block::InvalidBlockError::eq(&self, other: &bitcoin_primitives::block::InvalidBlockError) -> bool
pub fn bitcoin_primitives::block::InvalidBlockError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
@@ -1558,10 +1568,12 @@ pub fn bitcoin_primitives::block::VersionDecoderError::from(never: core::convert
pub fn bitcoin_primitives::block::VersionDecoderError::source(&self) -> core::option::Option<&(dyn core::error::Error + 'static)>
pub fn bitcoin_primitives::block::VersionEncoder::advance(&mut self) -> bool
pub fn bitcoin_primitives::block::VersionEncoder::current_chunk(&self) -> &[u8]
+pub fn bitcoin_primitives::block::VersionEncoder::len(&self) -> usize
pub fn bitcoin_primitives::block::compute_merkle_root(transactions: &[bitcoin_primitives::transaction::Transaction]) -> core::option::Option<bitcoin_primitives::TxMerkleNode>
pub fn bitcoin_primitives::block::compute_witness_root(transactions: &[bitcoin_primitives::transaction::Transaction]) -> core::option::Option<bitcoin_primitives::WitnessMerkleNode>
pub fn bitcoin_primitives::merkle_tree::TxMerkleNodeEncoder::advance(&mut self) -> bool
pub fn bitcoin_primitives::merkle_tree::TxMerkleNodeEncoder::current_chunk(&self) -> &[u8]
+pub fn bitcoin_primitives::merkle_tree::TxMerkleNodeEncoder::len(&self) -> usize
pub fn bitcoin_primitives::pow::CompactTarget::clone(&self) -> bitcoin_primitives::pow::CompactTarget
pub fn bitcoin_primitives::pow::CompactTarget::cmp(&self, other: &bitcoin_primitives::pow::CompactTarget) -> core::cmp::Ordering
pub fn bitcoin_primitives::pow::CompactTarget::decoder() -> Self::Decoder
@@ -1586,6 +1598,7 @@ pub fn bitcoin_primitives::pow::CompactTargetDecoderError::from(never: core::con
pub fn bitcoin_primitives::pow::CompactTargetDecoderError::source(&self) -> core::option::Option<&(dyn core::error::Error + 'static)>
pub fn bitcoin_primitives::pow::CompactTargetEncoder::advance(&mut self) -> bool
pub fn bitcoin_primitives::pow::CompactTargetEncoder::current_chunk(&self) -> &[u8]
+pub fn bitcoin_primitives::pow::CompactTargetEncoder::len(&self) -> usize
pub fn bitcoin_primitives::script::RedeemScriptSizeError::clone(&self) -> bitcoin_primitives::script::RedeemScriptSizeError
pub fn bitcoin_primitives::script::RedeemScriptSizeError::eq(&self, other: &bitcoin_primitives::script::RedeemScriptSizeError) -> bool
pub fn bitcoin_primitives::script::RedeemScriptSizeError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
@@ -1668,6 +1681,7 @@ pub fn bitcoin_primitives::script::ScriptBufDecoderError::from(never: core::conv
pub fn bitcoin_primitives::script::ScriptBufDecoderError::source(&self) -> core::option::Option<&(dyn core::error::Error + 'static)>
pub fn bitcoin_primitives::script::ScriptEncoder<'e>::advance(&mut self) -> bool
pub fn bitcoin_primitives::script::ScriptEncoder<'e>::current_chunk(&self) -> &[u8]
+pub fn bitcoin_primitives::script::ScriptEncoder<'e>::len(&self) -> usize
pub fn bitcoin_primitives::script::ScriptHash::arbitrary(u: &mut arbitrary::unstructured::Unstructured<'a>) -> arbitrary::error::Result<Self>
pub fn bitcoin_primitives::script::ScriptHash::as_ref(&self) -> &[u8; 20]
pub fn bitcoin_primitives::script::ScriptHash::as_ref(&self) -> &[u8]
@@ -1753,6 +1767,7 @@ pub fn bitcoin_primitives::transaction::OutPointDecoderError::fmt(&self, f: &mut
pub fn bitcoin_primitives::transaction::OutPointDecoderError::source(&self) -> core::option::Option<&(dyn core::error::Error + 'static)>
pub fn bitcoin_primitives::transaction::OutPointEncoder<'e>::advance(&mut self) -> bool
pub fn bitcoin_primitives::transaction::OutPointEncoder<'e>::current_chunk(&self) -> &[u8]
+pub fn bitcoin_primitives::transaction::OutPointEncoder<'e>::len(&self) -> usize
pub fn bitcoin_primitives::transaction::ParseOutPointError::clone(&self) -> bitcoin_primitives::transaction::ParseOutPointError
pub fn bitcoin_primitives::transaction::ParseOutPointError::eq(&self, other: &bitcoin_primitives::transaction::ParseOutPointError) -> bool
pub fn bitcoin_primitives::transaction::ParseOutPointError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
@@ -1860,6 +1875,7 @@ pub fn bitcoin_primitives::transaction::VersionDecoderError::from(never: core::c
pub fn bitcoin_primitives::transaction::VersionDecoderError::source(&self) -> core::option::Option<&(dyn core::error::Error + 'static)>
pub fn bitcoin_primitives::transaction::VersionEncoder::advance(&mut self) -> bool
pub fn bitcoin_primitives::transaction::VersionEncoder::current_chunk(&self) -> &[u8]
+pub fn bitcoin_primitives::transaction::VersionEncoder::len(&self) -> usize
pub fn bitcoin_primitives::transaction::WitnessesEncoder<'_>::advance(&mut self) -> bool
pub fn bitcoin_primitives::transaction::WitnessesEncoder<'_>::current_chunk(&self) -> &[u8]
pub fn bitcoin_primitives::transaction::WitnessesEncoder<'e>::new(inputs: &'e [bitcoin_primitives::transaction::TxIn]) -> Self
diff --git a/api/primitives/alloc-only.txt b/api/primitives/alloc-only.txt
index dc3dc482..07837944 100644
--- a/api/primitives/alloc-only.txt
+++ b/api/primitives/alloc-only.txt
@@ -47,6 +47,12 @@ impl bitcoin_consensus_encoding::encode::Encoder for bitcoin_primitives::pow::Co
impl bitcoin_consensus_encoding::encode::Encoder for bitcoin_primitives::transaction::VersionEncoder
impl bitcoin_consensus_encoding::encode::Encoder for bitcoin_primitives::transaction::WitnessesEncoder<'_>
impl bitcoin_consensus_encoding::encode::Encoder for bitcoin_primitives::witness::WitnessEncoder<'_>
+impl bitcoin_consensus_encoding::encode::ExactSizeEncoder for bitcoin_primitives::block::BlockHashEncoder
+impl bitcoin_consensus_encoding::encode::ExactSizeEncoder for bitcoin_primitives::block::HeaderEncoder
+impl bitcoin_consensus_encoding::encode::ExactSizeEncoder for bitcoin_primitives::block::VersionEncoder
+impl bitcoin_consensus_encoding::encode::ExactSizeEncoder for bitcoin_primitives::merkle_tree::TxMerkleNodeEncoder
+impl bitcoin_consensus_encoding::encode::ExactSizeEncoder for bitcoin_primitives::pow::CompactTargetEncoder
+impl bitcoin_consensus_encoding::encode::ExactSizeEncoder for bitcoin_primitives::transaction::VersionEncoder
impl bitcoin_primitives::BlockHash
impl bitcoin_primitives::Ntxid
impl bitcoin_primitives::TxMerkleNode
@@ -876,6 +882,8 @@ impl<'e> bitcoin_consensus_encoding::encode::Encoder for bitcoin_primitives::tra
impl<'e> bitcoin_consensus_encoding::encode::Encoder for bitcoin_primitives::transaction::TransactionEncoder<'e>
impl<'e> bitcoin_consensus_encoding::encode::Encoder for bitcoin_primitives::transaction::TxInEncoder<'e>
impl<'e> bitcoin_consensus_encoding::encode::Encoder for bitcoin_primitives::transaction::TxOutEncoder<'e>
+impl<'e> bitcoin_consensus_encoding::encode::ExactSizeEncoder for bitcoin_primitives::script::ScriptEncoder<'e>
+impl<'e> bitcoin_consensus_encoding::encode::ExactSizeEncoder for bitcoin_primitives::transaction::OutPointEncoder<'e>
impl<'e> bitcoin_primitives::transaction::WitnessesEncoder<'e>
impl<'e> core::marker::Freeze for bitcoin_primitives::block::BlockEncoder<'e>
impl<'e> core::marker::Freeze for bitcoin_primitives::script::ScriptEncoder<'e>
@@ -1303,6 +1311,7 @@ pub fn bitcoin_primitives::block::BlockHashDecoderError::from(e: bitcoin_consens
pub fn bitcoin_primitives::block::BlockHashDecoderError::from(never: core::convert::Infallible) -> Self
pub fn bitcoin_primitives::block::BlockHashEncoder::advance(&mut self) -> bool
pub fn bitcoin_primitives::block::BlockHashEncoder::current_chunk(&self) -> &[u8]
+pub fn bitcoin_primitives::block::BlockHashEncoder::len(&self) -> usize
pub fn bitcoin_primitives::block::Checked::clone(&self) -> bitcoin_primitives::block::Checked
pub fn bitcoin_primitives::block::Checked::cmp(&self, other: &bitcoin_primitives::block::Checked) -> core::cmp::Ordering
pub fn bitcoin_primitives::block::Checked::eq(&self, other: &bitcoin_primitives::block::Checked) -> bool
@@ -1327,6 +1336,7 @@ pub fn bitcoin_primitives::block::HeaderDecoderError::fmt(&self, f: &mut core::f
pub fn bitcoin_primitives::block::HeaderDecoderError::from(never: core::convert::Infallible) -> Self
pub fn bitcoin_primitives::block::HeaderEncoder::advance(&mut self) -> bool
pub fn bitcoin_primitives::block::HeaderEncoder::current_chunk(&self) -> &[u8]
+pub fn bitcoin_primitives::block::HeaderEncoder::len(&self) -> usize
pub fn bitcoin_primitives::block::InvalidBlockError::clone(&self) -> bitcoin_primitives::block::InvalidBlockError
pub fn bitcoin_primitives::block::InvalidBlockError::eq(&self, other: &bitcoin_primitives::block::InvalidBlockError) -> bool
pub fn bitcoin_primitives::block::InvalidBlockError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
@@ -1358,10 +1368,12 @@ pub fn bitcoin_primitives::block::VersionDecoderError::from(e: bitcoin_consensus
pub fn bitcoin_primitives::block::VersionDecoderError::from(never: core::convert::Infallible) -> Self
pub fn bitcoin_primitives::block::VersionEncoder::advance(&mut self) -> bool
pub fn bitcoin_primitives::block::VersionEncoder::current_chunk(&self) -> &[u8]
+pub fn bitcoin_primitives::block::VersionEncoder::len(&self) -> usize
pub fn bitcoin_primitives::block::compute_merkle_root(transactions: &[bitcoin_primitives::transaction::Transaction]) -> core::option::Option<bitcoin_primitives::TxMerkleNode>
pub fn bitcoin_primitives::block::compute_witness_root(transactions: &[bitcoin_primitives::transaction::Transaction]) -> core::option::Option<bitcoin_primitives::WitnessMerkleNode>
pub fn bitcoin_primitives::merkle_tree::TxMerkleNodeEncoder::advance(&mut self) -> bool
pub fn bitcoin_primitives::merkle_tree::TxMerkleNodeEncoder::current_chunk(&self) -> &[u8]
+pub fn bitcoin_primitives::merkle_tree::TxMerkleNodeEncoder::len(&self) -> usize
pub fn bitcoin_primitives::pow::CompactTarget::clone(&self) -> bitcoin_primitives::pow::CompactTarget
pub fn bitcoin_primitives::pow::CompactTarget::cmp(&self, other: &bitcoin_primitives::pow::CompactTarget) -> core::cmp::Ordering
pub fn bitcoin_primitives::pow::CompactTarget::decoder() -> Self::Decoder
@@ -1383,6 +1395,7 @@ pub fn bitcoin_primitives::pow::CompactTargetDecoderError::from(e: bitcoin_conse
pub fn bitcoin_primitives::pow::CompactTargetDecoderError::from(never: core::convert::Infallible) -> Self
pub fn bitcoin_primitives::pow::CompactTargetEncoder::advance(&mut self) -> bool
pub fn bitcoin_primitives::pow::CompactTargetEncoder::current_chunk(&self) -> &[u8]
+pub fn bitcoin_primitives::pow::CompactTargetEncoder::len(&self) -> usize
pub fn bitcoin_primitives::script::RedeemScriptSizeError::clone(&self) -> bitcoin_primitives::script::RedeemScriptSizeError
pub fn bitcoin_primitives::script::RedeemScriptSizeError::eq(&self, other: &bitcoin_primitives::script::RedeemScriptSizeError) -> bool
pub fn bitcoin_primitives::script::RedeemScriptSizeError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
@@ -1458,6 +1471,7 @@ pub fn bitcoin_primitives::script::ScriptBufDecoderError::from(e: bitcoin_consen
pub fn bitcoin_primitives::script::ScriptBufDecoderError::from(never: core::convert::Infallible) -> Self
pub fn bitcoin_primitives::script::ScriptEncoder<'e>::advance(&mut self) -> bool
pub fn bitcoin_primitives::script::ScriptEncoder<'e>::current_chunk(&self) -> &[u8]
+pub fn bitcoin_primitives::script::ScriptEncoder<'e>::len(&self) -> usize
pub fn bitcoin_primitives::script::ScriptHash::as_ref(&self) -> &[u8; 20]
pub fn bitcoin_primitives::script::ScriptHash::as_ref(&self) -> &[u8]
pub fn bitcoin_primitives::script::ScriptHash::borrow(&self) -> &[u8; 20]
@@ -1530,6 +1544,7 @@ pub fn bitcoin_primitives::transaction::OutPointDecoderError::eq(&self, other: &
pub fn bitcoin_primitives::transaction::OutPointDecoderError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
pub fn bitcoin_primitives::transaction::OutPointEncoder<'e>::advance(&mut self) -> bool
pub fn bitcoin_primitives::transaction::OutPointEncoder<'e>::current_chunk(&self) -> &[u8]
+pub fn bitcoin_primitives::transaction::OutPointEncoder<'e>::len(&self) -> usize
pub fn bitcoin_primitives::transaction::Transaction::clone(&self) -> bitcoin_primitives::transaction::Transaction
pub fn bitcoin_primitives::transaction::Transaction::cmp(&self, other: &Self) -> core::cmp::Ordering
pub fn bitcoin_primitives::transaction::Transaction::compute_ntxid(&self) -> bitcoin_primitives::Ntxid
@@ -1618,6 +1633,7 @@ pub fn bitcoin_primitives::transaction::VersionDecoderError::fmt(&self, f: &mut
pub fn bitcoin_primitives::transaction::VersionDecoderError::from(never: core::convert::Infallible) -> Self
pub fn bitcoin_primitives::transaction::VersionEncoder::advance(&mut self) -> bool
pub fn bitcoin_primitives::transaction::VersionEncoder::current_chunk(&self) -> &[u8]
+pub fn bitcoin_primitives::transaction::VersionEncoder::len(&self) -> usize
pub fn bitcoin_primitives::transaction::WitnessesEncoder<'_>::advance(&mut self) -> bool
pub fn bitcoin_primitives::transaction::WitnessesEncoder<'_>::current_chunk(&self) -> &[u8]
pub fn bitcoin_primitives::transaction::WitnessesEncoder<'e>::new(inputs: &'e [bitcoin_primitives::transaction::TxIn]) -> Self
diff --git a/api/primitives/no-features.txt b/api/primitives/no-features.txt
index 9a811381..b5141422 100644
--- a/api/primitives/no-features.txt
+++ b/api/primitives/no-features.txt
@@ -25,6 +25,12 @@ impl bitcoin_consensus_encoding::encode::Encoder for bitcoin_primitives::block::
impl bitcoin_consensus_encoding::encode::Encoder for bitcoin_primitives::merkle_tree::TxMerkleNodeEncoder
impl bitcoin_consensus_encoding::encode::Encoder for bitcoin_primitives::pow::CompactTargetEncoder
impl bitcoin_consensus_encoding::encode::Encoder for bitcoin_primitives::transaction::VersionEncoder
+impl bitcoin_consensus_encoding::encode::ExactSizeEncoder for bitcoin_primitives::block::BlockHashEncoder
+impl bitcoin_consensus_encoding::encode::ExactSizeEncoder for bitcoin_primitives::block::HeaderEncoder
+impl bitcoin_consensus_encoding::encode::ExactSizeEncoder for bitcoin_primitives::block::VersionEncoder
+impl bitcoin_consensus_encoding::encode::ExactSizeEncoder for bitcoin_primitives::merkle_tree::TxMerkleNodeEncoder
+impl bitcoin_consensus_encoding::encode::ExactSizeEncoder for bitcoin_primitives::pow::CompactTargetEncoder
+impl bitcoin_consensus_encoding::encode::ExactSizeEncoder for bitcoin_primitives::transaction::VersionEncoder
impl bitcoin_primitives::BlockHash
impl bitcoin_primitives::Ntxid
impl bitcoin_primitives::TxMerkleNode
@@ -418,6 +424,7 @@ impl core::panic::unwind_safe::UnwindSafe for bitcoin_primitives::transaction::V
impl core::panic::unwind_safe::UnwindSafe for bitcoin_primitives::transaction::VersionDecoderError
impl core::panic::unwind_safe::UnwindSafe for bitcoin_primitives::transaction::VersionEncoder
impl<'e> bitcoin_consensus_encoding::encode::Encoder for bitcoin_primitives::transaction::OutPointEncoder<'e>
+impl<'e> bitcoin_consensus_encoding::encode::ExactSizeEncoder for bitcoin_primitives::transaction::OutPointEncoder<'e>
impl<'e> core::marker::Freeze for bitcoin_primitives::transaction::OutPointEncoder<'e>
impl<'e> core::marker::Send for bitcoin_primitives::transaction::OutPointEncoder<'e>
impl<'e> core::marker::Sync for bitcoin_primitives::transaction::OutPointEncoder<'e>
@@ -581,6 +588,7 @@ pub fn bitcoin_primitives::block::BlockHashDecoderError::from(e: bitcoin_consens
pub fn bitcoin_primitives::block::BlockHashDecoderError::from(never: core::convert::Infallible) -> Self
pub fn bitcoin_primitives::block::BlockHashEncoder::advance(&mut self) -> bool
pub fn bitcoin_primitives::block::BlockHashEncoder::current_chunk(&self) -> &[u8]
+pub fn bitcoin_primitives::block::BlockHashEncoder::len(&self) -> usize
pub fn bitcoin_primitives::block::Header::block_hash(&self) -> bitcoin_primitives::BlockHash
pub fn bitcoin_primitives::block::Header::clone(&self) -> bitcoin_primitives::block::Header
pub fn bitcoin_primitives::block::Header::cmp(&self, other: &bitcoin_primitives::block::Header) -> core::cmp::Ordering
@@ -591,6 +599,7 @@ pub fn bitcoin_primitives::block::Header::hash<__H: core::hash::Hasher>(&self, s
pub fn bitcoin_primitives::block::Header::partial_cmp(&self, other: &bitcoin_primitives::block::Header) -> core::option::Option<core::cmp::Ordering>
pub fn bitcoin_primitives::block::HeaderEncoder::advance(&mut self) -> bool
pub fn bitcoin_primitives::block::HeaderEncoder::current_chunk(&self) -> &[u8]
+pub fn bitcoin_primitives::block::HeaderEncoder::len(&self) -> usize
pub fn bitcoin_primitives::block::Version::clone(&self) -> bitcoin_primitives::block::Version
pub fn bitcoin_primitives::block::Version::cmp(&self, other: &bitcoin_primitives::block::Version) -> core::cmp::Ordering
pub fn bitcoin_primitives::block::Version::decoder() -> Self::Decoder
@@ -612,8 +621,10 @@ pub fn bitcoin_primitives::block::VersionDecoderError::from(e: bitcoin_consensus
pub fn bitcoin_primitives::block::VersionDecoderError::from(never: core::convert::Infallible) -> Self
pub fn bitcoin_primitives::block::VersionEncoder::advance(&mut self) -> bool
pub fn bitcoin_primitives::block::VersionEncoder::current_chunk(&self) -> &[u8]
+pub fn bitcoin_primitives::block::VersionEncoder::len(&self) -> usize
pub fn bitcoin_primitives::merkle_tree::TxMerkleNodeEncoder::advance(&mut self) -> bool
pub fn bitcoin_primitives::merkle_tree::TxMerkleNodeEncoder::current_chunk(&self) -> &[u8]
+pub fn bitcoin_primitives::merkle_tree::TxMerkleNodeEncoder::len(&self) -> usize
pub fn bitcoin_primitives::pow::CompactTarget::clone(&self) -> bitcoin_primitives::pow::CompactTarget
pub fn bitcoin_primitives::pow::CompactTarget::cmp(&self, other: &bitcoin_primitives::pow::CompactTarget) -> core::cmp::Ordering
pub fn bitcoin_primitives::pow::CompactTarget::decoder() -> Self::Decoder
@@ -634,6 +645,7 @@ pub fn bitcoin_primitives::pow::CompactTargetDecoderError::from(e: bitcoin_conse
pub fn bitcoin_primitives::pow::CompactTargetDecoderError::from(never: core::convert::Infallible) -> Self
pub fn bitcoin_primitives::pow::CompactTargetEncoder::advance(&mut self) -> bool
pub fn bitcoin_primitives::pow::CompactTargetEncoder::current_chunk(&self) -> &[u8]
+pub fn bitcoin_primitives::pow::CompactTargetEncoder::len(&self) -> usize
pub fn bitcoin_primitives::transaction::OutPoint::clone(&self) -> bitcoin_primitives::transaction::OutPoint
pub fn bitcoin_primitives::transaction::OutPoint::cmp(&self, other: &bitcoin_primitives::transaction::OutPoint) -> core::cmp::Ordering
pub fn bitcoin_primitives::transaction::OutPoint::decoder() -> Self::Decoder
@@ -651,6 +663,7 @@ pub fn bitcoin_primitives::transaction::OutPointDecoderError::eq(&self, other: &
pub fn bitcoin_primitives::transaction::OutPointDecoderError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
pub fn bitcoin_primitives::transaction::OutPointEncoder<'e>::advance(&mut self) -> bool
pub fn bitcoin_primitives::transaction::OutPointEncoder<'e>::current_chunk(&self) -> &[u8]
+pub fn bitcoin_primitives::transaction::OutPointEncoder<'e>::len(&self) -> usize
pub fn bitcoin_primitives::transaction::TxMerkleNodeDecoder::default() -> Self
pub fn bitcoin_primitives::transaction::TxMerkleNodeDecoder::end(self) -> core::result::Result<Self::Output, Self::Error>
pub fn bitcoin_primitives::transaction::TxMerkleNodeDecoder::push_bytes(&mut self, bytes: &mut &[u8]) -> core::result::Result<bool, Self::Error>
@@ -678,6 +691,7 @@ pub fn bitcoin_primitives::transaction::VersionDecoderError::fmt(&self, f: &mut
pub fn bitcoin_primitives::transaction::VersionDecoderError::from(never: core::convert::Infallible) -> Self
pub fn bitcoin_primitives::transaction::VersionEncoder::advance(&mut self) -> bool
pub fn bitcoin_primitives::transaction::VersionEncoder::current_chunk(&self) -> &[u8]
+pub fn bitcoin_primitives::transaction::VersionEncoder::len(&self) -> usize
pub fn u32::from(version: bitcoin_primitives::transaction::Version) -> Self
pub mod bitcoin_primitives
pub mod bitcoin_primitives::block
diff --git a/api/units/all-features.txt b/api/units/all-features.txt
index faf2c928..edaf1c02 100644
--- a/api/units/all-features.txt
+++ b/api/units/all-features.txt
@@ -32,6 +32,11 @@ impl bitcoin_consensus_encoding::encode::Encoder for bitcoin_units::block::Block
impl bitcoin_consensus_encoding::encode::Encoder for bitcoin_units::locktime::absolute::LockTimeEncoder
impl bitcoin_consensus_encoding::encode::Encoder for bitcoin_units::sequence::SequenceEncoder
impl bitcoin_consensus_encoding::encode::Encoder for bitcoin_units::time::BlockTimeEncoder
+impl bitcoin_consensus_encoding::encode::ExactSizeEncoder for bitcoin_units::amount::AmountEncoder
+impl bitcoin_consensus_encoding::encode::ExactSizeEncoder for bitcoin_units::block::BlockHeightEncoder
+impl bitcoin_consensus_encoding::encode::ExactSizeEncoder for bitcoin_units::locktime::absolute::LockTimeEncoder
+impl bitcoin_consensus_encoding::encode::ExactSizeEncoder for bitcoin_units::sequence::SequenceEncoder
+impl bitcoin_consensus_encoding::encode::ExactSizeEncoder for bitcoin_units::time::BlockTimeEncoder
impl bitcoin_units::Amount
impl bitcoin_units::BlockTime
impl bitcoin_units::FeeRate
@@ -1938,6 +1943,7 @@ pub fn bitcoin_units::amount::AmountDecoder::push_bytes(&mut self, bytes: &mut &
pub fn bitcoin_units::amount::AmountDecoder::read_limit(&self) -> usize
pub fn bitcoin_units::amount::AmountEncoder::advance(&mut self) -> bool
pub fn bitcoin_units::amount::AmountEncoder::current_chunk(&self) -> &[u8]
+pub fn bitcoin_units::amount::AmountEncoder::len(&self) -> usize
pub fn bitcoin_units::amount::Denomination::arbitrary(u: &mut arbitrary::unstructured::Unstructured<'a>) -> arbitrary::error::Result<Self>
pub fn bitcoin_units::amount::Denomination::clone(&self) -> bitcoin_units::amount::Denomination
pub fn bitcoin_units::amount::Denomination::eq(&self, other: &bitcoin_units::amount::Denomination) -> bool
@@ -2061,6 +2067,7 @@ pub fn bitcoin_units::block::BlockHeightDecoderError::from(never: core::convert:
pub fn bitcoin_units::block::BlockHeightDecoderError::source(&self) -> core::option::Option<&(dyn core::error::Error + 'static)>
pub fn bitcoin_units::block::BlockHeightEncoder::advance(&mut self) -> bool
pub fn bitcoin_units::block::BlockHeightEncoder::current_chunk(&self) -> &[u8]
+pub fn bitcoin_units::block::BlockHeightEncoder::len(&self) -> usize
pub fn bitcoin_units::block::BlockHeightInterval::add(self, rhs: &bitcoin_units::block::BlockHeightInterval) -> Self::Output
pub fn bitcoin_units::block::BlockHeightInterval::add(self, rhs: bitcoin_units::block::BlockHeightInterval) -> Self::Output
pub fn bitcoin_units::block::BlockHeightInterval::add_assign(&mut self, rhs: &bitcoin_units::block::BlockHeightInterval)
@@ -2205,6 +2212,7 @@ pub fn bitcoin_units::locktime::absolute::LockTimeDecoder::push_bytes(&mut self,
pub fn bitcoin_units::locktime::absolute::LockTimeDecoder::read_limit(&self) -> usize
pub fn bitcoin_units::locktime::absolute::LockTimeEncoder::advance(&mut self) -> bool
pub fn bitcoin_units::locktime::absolute::LockTimeEncoder::current_chunk(&self) -> &[u8]
+pub fn bitcoin_units::locktime::absolute::LockTimeEncoder::len(&self) -> usize
pub fn bitcoin_units::locktime::absolute::MedianTimePast::arbitrary(u: &mut arbitrary::unstructured::Unstructured<'a>) -> arbitrary::error::Result<Self>
pub fn bitcoin_units::locktime::absolute::MedianTimePast::clone(&self) -> bitcoin_units::locktime::absolute::MedianTimePast
pub fn bitcoin_units::locktime::absolute::MedianTimePast::cmp(&self, other: &bitcoin_units::locktime::absolute::MedianTimePast) -> core::cmp::Ordering
@@ -2487,6 +2495,7 @@ pub fn bitcoin_units::sequence::SequenceDecoderError::from(never: core::convert:
pub fn bitcoin_units::sequence::SequenceDecoderError::source(&self) -> core::option::Option<&(dyn core::error::Error + 'static)>
pub fn bitcoin_units::sequence::SequenceEncoder::advance(&mut self) -> bool
pub fn bitcoin_units::sequence::SequenceEncoder::current_chunk(&self) -> &[u8]
+pub fn bitcoin_units::sequence::SequenceEncoder::len(&self) -> usize
pub fn bitcoin_units::time::BlockTimeDecoder::default() -> Self
pub fn bitcoin_units::time::BlockTimeDecoder::end(self) -> core::result::Result<Self::Output, Self::Error>
pub fn bitcoin_units::time::BlockTimeDecoder::push_bytes(&mut self, bytes: &mut &[u8]) -> core::result::Result<bool, Self::Error>
@@ -2498,6 +2507,7 @@ pub fn bitcoin_units::time::BlockTimeDecoderError::from(never: core::convert::In
pub fn bitcoin_units::time::BlockTimeDecoderError::source(&self) -> core::option::Option<&(dyn core::error::Error + 'static)>
pub fn bitcoin_units::time::BlockTimeEncoder::advance(&mut self) -> bool
pub fn bitcoin_units::time::BlockTimeEncoder::current_chunk(&self) -> &[u8]
+pub fn bitcoin_units::time::BlockTimeEncoder::len(&self) -> usize
pub fn core::num::error::ParseIntError::from(value: bitcoin_units::parse_int::ParseIntError) -> Self
pub fn i64::mul(self, rhs: &bitcoin_units::SignedAmount) -> Self::Output
pub fn i64::mul(self, rhs: &bitcoin_units::result::NumOpResult<bitcoin_units::SignedAmount>) -> Self::Output
diff --git a/consensus_encoding/examples/encoder.rs b/consensus_encoding/examples/encoder.rs
index 9bd8127f..30453b6a 100644
--- a/consensus_encoding/examples/encoder.rs
+++ b/consensus_encoding/examples/encoder.rs
@@ -61,7 +61,7 @@ impl Inner {
pub fn to_array(&self) -> [u8; 4] { self.0.to_be_bytes() }
}
-encoding::encoder_newtype! {
+encoding::encoder_newtype_exact! {
/// The encoder for the [`Inner`] type.
pub struct InnerEncoder(ArrayEncoder<4>);
}
diff --git a/consensus_encoding/src/encode/encoders.rs b/consensus_encoding/src/encode/encoders.rs
index 823fd5b3..4ab239b0 100644
--- a/consensus_encoding/src/encode/encoders.rs
+++ b/consensus_encoding/src/encode/encoders.rs
@@ -8,12 +8,13 @@
//! to your newtype. This avoids leaking encoding implementation details to the
//! users of your type.
//!
-//! For implementing these newtypes, we provide the [`encoder_newtype`] macro.
+//! For implementing these newtypes, we provide the [`encoder_newtype`] and
+//! [`encoder_newtype_exact`] macros.
//!
use internals::array_vec::ArrayVec;
-use super::{Encodable, Encoder};
+use super::{Encodable, Encoder, ExactSizeEncoder};
/// The maximum length of a compact size encoding.
const SIZE: usize = 9;
@@ -37,6 +38,13 @@ impl Encoder for BytesEncoder<'_> {
}
}
+impl<'sl> ExactSizeEncoder for BytesEncoder<'sl> {
+ #[inline]
+ fn len(&self) -> usize {
+ self.sl.map_or(0, <[u8]>::len)
+ }
+}
+
/// An encoder for a single array.
pub struct ArrayEncoder<const N: usize> {
arr: Option<[u8; N]>,
@@ -58,6 +66,11 @@ impl<const N: usize> Encoder for ArrayEncoder<N> {
}
}
+impl<const N: usize> ExactSizeEncoder for ArrayEncoder<N> {
+ #[inline]
+ fn len(&self) -> usize { self.arr.map_or(0, |a| a.len()) }
+}
+
/// An encoder for a list of encodable types.
pub struct SliceEncoder<'e, T: Encodable> {
/// The list of references to the objects we are encoding.
@@ -149,6 +162,15 @@ impl<A: Encoder, B: Encoder> Encoder for Encoder2<A, B> {
}
}
+impl<A, B> ExactSizeEncoder for Encoder2<A, B>
+where
+ A: Encoder + ExactSizeEncoder,
+ B: Encoder + ExactSizeEncoder,
+{
+ #[inline]
+ fn len(&self) -> usize { self.enc_1.len() + self.enc_2.len() }
+}
+
// For now we implement every higher encoder by composing Encoder2s, because
// I'm lazy and this is trivial both to write and to review. For efficiency, we
// should eventually unroll all of these. There are only a couple of them. The
@@ -173,6 +195,16 @@ impl<A: Encoder, B: Encoder, C: Encoder> Encoder for Encoder3<A, B, C> {
fn advance(&mut self) -> bool { self.inner.advance() }
}
+impl<A, B, C> ExactSizeEncoder for Encoder3<A, B, C>
+where
+ A: Encoder + ExactSizeEncoder,
+ B: Encoder + ExactSizeEncoder,
+ C: Encoder + ExactSizeEncoder,
+{
+ #[inline]
+ fn len(&self) -> usize { self.inner.len() }
+}
+
/// An encoder which encodes four objects, one after the other.
pub struct Encoder4<A, B, C, D> {
inner: Encoder2<Encoder2<A, B>, Encoder2<C, D>>,
@@ -192,6 +224,17 @@ impl<A: Encoder, B: Encoder, C: Encoder, D: Encoder> Encoder for Encoder4<A, B,
fn advance(&mut self) -> bool { self.inner.advance() }
}
+impl<A, B, C, D> ExactSizeEncoder for Encoder4<A, B, C, D>
+where
+ A: Encoder + ExactSizeEncoder,
+ B: Encoder + ExactSizeEncoder,
+ C: Encoder + ExactSizeEncoder,
+ D: Encoder + ExactSizeEncoder,
+{
+ #[inline]
+ fn len(&self) -> usize { self.inner.len() }
+}
+
/// An encoder which encodes six objects, one after the other.
pub struct Encoder6<A, B, C, D, E, F> {
inner: Encoder2<Encoder3<A, B, C>, Encoder3<D, E, F>>,
@@ -218,6 +261,19 @@ impl<A: Encoder, B: Encoder, C: Encoder, D: Encoder, E: Encoder, F: Encoder> Enc
fn advance(&mut self) -> bool { self.inner.advance() }
}
+impl<A, B, C, D, E, F> ExactSizeEncoder for Encoder6<A, B, C, D, E, F>
+where
+ A: Encoder + ExactSizeEncoder,
+ B: Encoder + ExactSizeEncoder,
+ C: Encoder + ExactSizeEncoder,
+ D: Encoder + ExactSizeEncoder,
+ E: Encoder + ExactSizeEncoder,
+ F: Encoder + ExactSizeEncoder,
+{
+ #[inline]
+ fn len(&self) -> usize { self.inner.len() }
+}
+
/// Encoder for a compact size encoded integer.
pub struct CompactSizeEncoder {
buf: Option<ArrayVec<u8, SIZE>>,
@@ -289,6 +345,11 @@ impl Encoder for CompactSizeEncoder {
}
}
+impl ExactSizeEncoder for CompactSizeEncoder {
+ #[inline]
+ fn len(&self) -> usize { self.buf.map_or(0, |buf| buf.len()) }
+}
+
#[cfg(test)]
mod tests {
use super::*;
@@ -320,6 +381,8 @@ mod tests {
// Should have one chunk with the array data, then exhausted.
let test_array = TestArray([1u8, 2, 3, 4]);
let mut encoder = test_array.encoder();
+ assert_eq!(encoder.len(), 4);
+ assert!(!encoder.is_empty());
assert_eq!(encoder.current_chunk(), &[1u8, 2, 3, 4][..]);
assert!(!encoder.advance());
assert!(encoder.current_chunk().is_empty());
@@ -330,6 +393,8 @@ mod tests {
// Empty array should have one empty chunk, then exhausted.
let test_array = TestArray([]);
let mut encoder = test_array.encoder();
+ assert_eq!(encoder.len(), 0);
+ assert!(encoder.is_empty());
assert!(encoder.current_chunk().is_empty());
assert!(!encoder.advance());
assert!(encoder.current_chunk().is_empty());
@@ -342,6 +407,9 @@ mod tests {
let test_bytes = TestBytes(&obj);
let mut encoder = test_bytes.encoder();
+ assert_eq!(encoder.len(), 3);
+ assert!(!encoder.is_empty());
+
assert_eq!(encoder.current_chunk(), &[1u8, 2, 3][..]);
assert!(!encoder.advance());
assert!(encoder.current_chunk().is_empty());
@@ -354,6 +422,9 @@ mod tests {
let test_bytes = TestBytes(&obj);
let mut encoder = test_bytes.encoder();
+ assert_eq!(encoder.len(), 0);
+ assert!(encoder.is_empty());
+
assert!(encoder.current_chunk().is_empty());
assert!(!encoder.advance());
assert!(encoder.current_chunk().is_empty());
@@ -401,6 +472,9 @@ mod tests {
let enc2 = TestArray([3u8, 4]).encoder();
let mut encoder = Encoder2::new(enc1, enc2);
+ assert_eq!(encoder.len(), 4);
+ assert!(!encoder.is_empty());
+
assert_eq!(encoder.current_chunk(), &[1u8, 2][..]);
assert!(encoder.advance());
assert_eq!(encoder.current_chunk(), &[3u8, 4][..]);
@@ -415,6 +489,9 @@ mod tests {
let enc2 = TestArray([]).encoder();
let mut encoder = Encoder2::new(enc1, enc2);
+ assert_eq!(encoder.len(), 0);
+ assert!(encoder.is_empty());
+
assert!(encoder.current_chunk().is_empty());
assert!(encoder.advance());
assert!(encoder.current_chunk().is_empty());
@@ -430,6 +507,9 @@ mod tests {
let enc3 = TestArray([4u8, 5u8, 6u8]).encoder();
let mut encoder = Encoder3::new(enc1, enc2, enc3);
+ assert_eq!(encoder.len(), 6);
+ assert!(!encoder.is_empty());
+
assert_eq!(encoder.current_chunk(), &[1u8][..]);
assert!(encoder.advance());
assert_eq!(encoder.current_chunk(), &[2u8, 3u8][..]);
@@ -448,6 +528,9 @@ mod tests {
let enc4 = TestArray([0x40]).encoder();
let mut encoder = Encoder4::new(enc1, enc2, enc3, enc4);
+ assert_eq!(encoder.len(), 4);
+ assert!(!encoder.is_empty());
+
assert_eq!(encoder.current_chunk(), &[0x10][..]);
assert!(encoder.advance());
assert_eq!(encoder.current_chunk(), &[0x20][..]);
@@ -470,6 +553,9 @@ mod tests {
let enc6 = TestArray([0x06]).encoder();
let mut encoder = Encoder6::new(enc1, enc2, enc3, enc4, enc5, enc6);
+ assert_eq!(encoder.len(), 6);
+ assert!(!encoder.is_empty());
+
assert_eq!(encoder.current_chunk(), &[0x01][..]);
assert!(encoder.advance());
assert_eq!(encoder.current_chunk(), &[0x02][..]);
@@ -492,6 +578,9 @@ mod tests {
let enc2 = TestArray([0xDD, 0xCC]).encoder();
let mut encoder = Encoder2::new(enc1, enc2);
+ assert_eq!(encoder.len(), 4);
+ assert!(!encoder.is_empty());
+
assert_eq!(encoder.current_chunk(), &[0xFF, 0xEE][..]);
assert!(encoder.advance());
assert_eq!(encoder.current_chunk(), &[0xDD, 0xCC][..]);
@@ -507,6 +596,9 @@ mod tests {
let enc3 = TestArray([0x43, 0x44, 0x45]).encoder();
let mut encoder = Encoder3::new(enc1, enc2, enc3);
+ assert_eq!(encoder.len(), 4);
+ assert!(!encoder.is_empty());
+
assert!(encoder.current_chunk().is_empty());
assert!(encoder.advance());
assert_eq!(encoder.current_chunk(), &[0x42][..]);
@@ -605,33 +697,39 @@ mod tests {
// 1-byte
let mut e = CompactSizeEncoder::new(0x10usize);
assert_eq!(e.current_chunk(), &[0x10][..]);
+ assert_eq!(e.len(), 1);
assert!(!e.advance());
assert!(e.current_chunk().is_empty());
let mut e = CompactSizeEncoder::new(0xFCusize);
assert_eq!(e.current_chunk(), &[0xFC][..]);
+ assert_eq!(e.len(), 1);
assert!(!e.advance());
assert!(e.current_chunk().is_empty());
// 0xFD + u16
let mut e = CompactSizeEncoder::new(0x00FDusize);
assert_eq!(e.current_chunk(), &[0xFD, 0xFD, 0x00][..]);
+ assert_eq!(e.len(), 3);
assert!(!e.advance());
assert!(e.current_chunk().is_empty());
let mut e = CompactSizeEncoder::new(0x0FFFusize);
assert_eq!(e.current_chunk(), &[0xFD, 0xFF, 0x0F][..]);
+ assert_eq!(e.len(), 3);
assert!(!e.advance());
assert!(e.current_chunk().is_empty());
// 0xFE + u32
let mut e = CompactSizeEncoder::new(0x0001_0000usize);
assert_eq!(e.current_chunk(), &[0xFE, 0x00, 0x00, 0x01, 0x00][..]);
+ assert_eq!(e.len(), 5);
assert!(!e.advance());
assert!(e.current_chunk().is_empty());
let mut e = CompactSizeEncoder::new(0x0F0F_0F0Fusize);
assert_eq!(e.current_chunk(), &[0xFE, 0x0F, 0x0F, 0x0F, 0x0F][..]);
+ assert_eq!(e.len(), 5);
assert!(!e.advance());
assert!(e.current_chunk().is_empty());
@@ -643,6 +741,7 @@ mod tests {
e.current_chunk(),
&[0xFF, 0xE0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00][..]
);
+ assert_eq!(e.len(), 9);
assert!(!e.advance());
assert!(e.current_chunk().is_empty());
}
@@ -655,6 +754,7 @@ mod tests {
e.current_chunk(),
&[0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF][..]
);
+ assert_eq!(e.len(), 9);
assert!(!e.advance());
assert!(e.current_chunk().is_empty());
}
@@ -713,15 +813,17 @@ mod tests {
fn iter_encoder() {
let test_array = TestArray([1u8, 2, 3, 4]);
let mut iter = crate::EncodableByteIter::new(&test_array);
- let mut byte = iter.next().unwrap();
- assert_eq!(byte, 1u8);
- byte = iter.next().unwrap();
- assert_eq!(byte, 2u8);
- byte = iter.next().unwrap();
- assert_eq!(byte, 3u8);
- byte = iter.next().unwrap();
- assert_eq!(byte, 4u8);
- let none = iter.next();
- assert_eq!(none, None);
+
+ assert_eq!(iter.len(), 4);
+
+ assert_eq!(iter.next().unwrap(), 1);
+ assert_eq!(iter.len(), 3);
+ assert_eq!(iter.next().unwrap(), 2);
+ assert_eq!(iter.len(), 2);
+ assert_eq!(iter.next().unwrap(), 3);
+ assert_eq!(iter.len(), 1);
+ assert_eq!(iter.next().unwrap(), 4);
+ assert_eq!(iter.len(), 0);
+ assert!(iter.next().is_none());
}
}
diff --git a/consensus_encoding/src/encode/mod.rs b/consensus_encoding/src/encode/mod.rs
index e5c7f98b..d6ec9f24 100644
--- a/consensus_encoding/src/encode/mod.rs
+++ b/consensus_encoding/src/encode/mod.rs
@@ -64,6 +64,27 @@ macro_rules! encoder_newtype{
}
}
+/// Implements a newtype around an exact-size encoder which
+/// implements the [`Encoder`] and [`ExactSizeEncoder`] traits
+/// by forwarding to the wrapped encoder.
+#[macro_export]
+macro_rules! encoder_newtype_exact{
+ (
+ $(#[$($struct_attr:tt)*])*
+ pub struct $name:ident$(<$lt:lifetime>)?($encoder:ty);
+ ) => {
+ $crate::encoder_newtype! {
+ $(#[$($struct_attr)*])*
+ pub struct $name$(<$lt>)?($encoder);
+ }
+
+ impl$(<$lt>)? $crate::ExactSizeEncoder for $name$(<$lt>)? {
+ #[inline]
+ fn len(&self) -> usize { self.0.len() }
+ }
+ }
+}
+
/// Yields bytes from any [`Encodable`] instance.
pub struct EncodableByteIter<'s, T: Encodable + 's> {
enc: T::Encoder<'s>,
@@ -91,6 +112,24 @@ impl<'s, T: Encodable + 's> Iterator for EncodableByteIter<'s, T> {
}
}
+impl<'s, T> ExactSizeIterator for EncodableByteIter<'s, T>
+where
+ T: Encodable + 's,
+ T::Encoder<'s>: ExactSizeEncoder
+{
+ fn len(&self) -> usize { self.enc.len() - self.position }
+}
+
+
+/// An encoder with a known size.
+pub trait ExactSizeEncoder: Encoder {
+ /// The number of bytes remaining that the encoder will yield.
+ fn len(&self) -> usize;
+
+ /// Returns whether the encoder would yield an empty response.
+ fn is_empty(&self) -> bool { self.len() == 0 }
+}
+
/// Encodes an object into a vector.
#[cfg(feature = "alloc")]
pub fn encode_to_vec<T>(object: &T) -> Vec<u8>
diff --git a/consensus_encoding/src/lib.rs b/consensus_encoding/src/lib.rs
index 2f5a315b..0c659f71 100644
--- a/consensus_encoding/src/lib.rs
+++ b/consensus_encoding/src/lib.rs
@@ -41,4 +41,4 @@ pub use self::encode::encoders::{
ArrayEncoder, BytesEncoder, CompactSizeEncoder, Encoder2, Encoder3, Encoder4, Encoder6,
SliceEncoder,
};
-pub use self::encode::{Encodable, EncodableByteIter, Encoder};
+pub use self::encode::{Encodable, EncodableByteIter, Encoder, ExactSizeEncoder};
diff --git a/consensus_encoding/tests/wrappers.rs b/consensus_encoding/tests/wrappers.rs
index 674c022b..3884d1c2 100644
--- a/consensus_encoding/tests/wrappers.rs
+++ b/consensus_encoding/tests/wrappers.rs
@@ -5,12 +5,12 @@
use bitcoin_consensus_encoding as encoding;
use encoding::{ArrayEncoder, BytesEncoder, CompactSizeEncoder, Encodable, Encoder2, SliceEncoder};
-encoding::encoder_newtype! {
+encoding::encoder_newtype_exact! {
/// An encoder that uses an inner `ArrayEncoder`.
pub struct TestArrayEncoder(ArrayEncoder<4>);
}
-encoding::encoder_newtype! {
+encoding::encoder_newtype_exact! {
/// An encoder that uses an inner `BytesEncoder`.
pub struct TestBytesEncoder<'e>(BytesEncoder<'e>);
}
@@ -113,7 +113,7 @@ fn slice_encoder() {
#[derive(Debug, Default, Clone)]
pub struct Inner(u32);
- encoding::encoder_newtype! {
+ encoding::encoder_newtype_exact! {
/// The encoder for the [`Inner`] type.
pub struct InnerArrayEncoder(ArrayEncoder<4>);
}
diff --git a/p2p/src/message.rs b/p2p/src/message.rs
index 555c5a38..1d2b48e9 100644
--- a/p2p/src/message.rs
+++ b/p2p/src/message.rs
@@ -346,7 +346,7 @@ impl bitcoin::consensus::encode::Decodable for FeeFilter {
}
}
-encoding::encoder_newtype! {
+encoding::encoder_newtype_exact! {
/// Encoder for [`FeeFilter`] type.
pub struct FeeFilterEncoder(encoding::ArrayEncoder<8>);
}
diff --git a/primitives/src/block.rs b/primitives/src/block.rs
index 26a2a62e..482dfef5 100644
--- a/primitives/src/block.rs
+++ b/primitives/src/block.rs
@@ -587,7 +587,7 @@ impl std::error::Error for ParseHeaderError {
}
}
-encoding::encoder_newtype! {
+encoding::encoder_newtype_exact! {
/// The encoder for the [`Header`] type.
pub struct HeaderEncoder(
encoding::Encoder6<
@@ -816,7 +816,7 @@ impl Default for Version {
fn default() -> Self { Self::NO_SOFT_FORK_SIGNALLING }
}
-encoding::encoder_newtype! {
+encoding::encoder_newtype_exact! {
/// The encoder for the [`Version`] type.
pub struct VersionEncoder(encoding::ArrayEncoder<4>);
}
diff --git a/primitives/src/hash_types/block_hash.rs b/primitives/src/hash_types/block_hash.rs
index ea0e35c0..630dd7d9 100644
--- a/primitives/src/hash_types/block_hash.rs
+++ b/primitives/src/hash_types/block_hash.rs
@@ -29,7 +29,7 @@ type Inner = sha256d::Hash;
include!("./generic.rs");
-encoding::encoder_newtype! {
+encoding::encoder_newtype_exact! {
/// The encoder for the [`BlockHash`] type.
pub struct BlockHashEncoder(encoding::ArrayEncoder<32>);
}
diff --git a/primitives/src/hash_types/transaction_merkle_node.rs b/primitives/src/hash_types/transaction_merkle_node.rs
index 8f962b18..e73a0e50 100644
--- a/primitives/src/hash_types/transaction_merkle_node.rs
+++ b/primitives/src/hash_types/transaction_merkle_node.rs
@@ -48,7 +48,7 @@ impl TxMerkleNode {
}
}
-encoding::encoder_newtype! {
+encoding::encoder_newtype_exact! {
/// The encoder for the [`TxMerkleNode`] type.
pub struct TxMerkleNodeEncoder(encoding::ArrayEncoder<32>);
}
diff --git a/primitives/src/hash_types/witness_merkle_node.rs b/primitives/src/hash_types/witness_merkle_node.rs
index 4217bb45..68e3eef1 100644
--- a/primitives/src/hash_types/witness_merkle_node.rs
+++ b/primitives/src/hash_types/witness_merkle_node.rs
@@ -48,7 +48,7 @@ impl WitnessMerkleNode {
}
}
-encoding::encoder_newtype! {
+encoding::encoder_newtype_exact! {
/// The encoder for the [`WitnessMerkleNode`] type.
pub struct WitnessMerkleNodeEncoder(encoding::ArrayEncoder<32>);
}
diff --git a/primitives/src/pow.rs b/primitives/src/pow.rs
index 75f4d143..aa681665 100644
--- a/primitives/src/pow.rs
+++ b/primitives/src/pow.rs
@@ -51,7 +51,7 @@ impl fmt::UpperHex for CompactTarget {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::UpperHex::fmt(&self.0, f) }
}
-encoding::encoder_newtype! {
+encoding::encoder_newtype_exact! {
/// The encoder for the [`CompactTarget`] type.
pub struct CompactTargetEncoder(encoding::ArrayEncoder<4>);
}
diff --git a/primitives/src/script/borrowed.rs b/primitives/src/script/borrowed.rs
index d75cc6a1..01e59d67 100644
--- a/primitives/src/script/borrowed.rs
+++ b/primitives/src/script/borrowed.rs
@@ -153,7 +153,7 @@ impl<T> Script<T> {
pub fn to_hex(&self) -> alloc::string::String { alloc::format!("{:x}", self) }
}
-encoding::encoder_newtype! {
+encoding::encoder_newtype_exact! {
/// The encoder for the [`Script<T>`] type.
pub struct ScriptEncoder<'e>(Encoder2<CompactSizeEncoder, BytesEncoder<'e>>);
}
diff --git a/primitives/src/transaction.rs b/primitives/src/transaction.rs
index 60fddd81..af401913 100644
--- a/primitives/src/transaction.rs
+++ b/primitives/src/transaction.rs
@@ -1119,7 +1119,7 @@ impl OutPoint {
pub const COINBASE_PREVOUT: Self = Self { txid: Txid::COINBASE_PREVOUT, vout: u32::MAX };
}
-encoding::encoder_newtype! {
+encoding::encoder_newtype_exact! {
/// The encoder for the [`OutPoint`] type.
pub struct OutPointEncoder<'e>(Encoder2<BytesEncoder<'e>, ArrayEncoder<4>>);
}
@@ -1464,7 +1464,7 @@ impl From<Version> for u32 {
fn from(version: Version) -> Self { version.0 }
}
-encoding::encoder_newtype! {
+encoding::encoder_newtype_exact! {
/// The encoder for the [`Version`] type.
pub struct VersionEncoder(encoding::ArrayEncoder<4>);
}
diff --git a/units/src/amount/unsigned.rs b/units/src/amount/unsigned.rs
index 7c96ce56..aeee7240 100644
--- a/units/src/amount/unsigned.rs
+++ b/units/src/amount/unsigned.rs
@@ -557,7 +557,7 @@ impl TryFrom<SignedAmount> for Amount {
}
#[cfg(feature = "encoding")]
-encoding::encoder_newtype! {
+encoding::encoder_newtype_exact! {
/// The encoder for the [`Amount`] type.
pub struct AmountEncoder(encoding::ArrayEncoder<8>);
}
diff --git a/units/src/block.rs b/units/src/block.rs
index 5fb3f517..bb0ad874 100644
--- a/units/src/block.rs
+++ b/units/src/block.rs
@@ -144,7 +144,7 @@ impl TryFrom<BlockHeight> for absolute::Height {
}
#[cfg(feature = "encoding")]
-encoding::encoder_newtype! {
+encoding::encoder_newtype_exact! {
/// The encoder for the [`BlockHeight`] type.
pub struct BlockHeightEncoder(encoding::ArrayEncoder<4>);
}
diff --git a/units/src/locktime/absolute/mod.rs b/units/src/locktime/absolute/mod.rs
index 06b39a13..9bf7622a 100644
--- a/units/src/locktime/absolute/mod.rs
+++ b/units/src/locktime/absolute/mod.rs
@@ -398,7 +398,7 @@ impl LockTime {
parse_int::impl_parse_str_from_int_infallible!(LockTime, u32, from_consensus);
#[cfg(feature = "encoding")]
-encoding::encoder_newtype! {
+encoding::encoder_newtype_exact! {
/// The encoder for the [`LockTime`] type.
pub struct LockTimeEncoder(encoding::ArrayEncoder<4>);
}
diff --git a/units/src/sequence.rs b/units/src/sequence.rs
index 321c63e5..3ffd0f6b 100644
--- a/units/src/sequence.rs
+++ b/units/src/sequence.rs
@@ -267,7 +267,7 @@ impl fmt::Debug for Sequence {
parse_int::impl_parse_str_from_int_infallible!(Sequence, u32, from_consensus);
#[cfg(feature = "encoding")]
-encoding::encoder_newtype! {
+encoding::encoder_newtype_exact! {
/// The encoder for the [`Sequence`] type.
pub struct SequenceEncoder(encoding::ArrayEncoder<4>);
}
diff --git a/units/src/time.rs b/units/src/time.rs
index a16b3906..d6ec602b 100644
--- a/units/src/time.rs
+++ b/units/src/time.rs
@@ -81,7 +81,7 @@ impl<'de> Deserialize<'de> for BlockTime {
}
#[cfg(feature = "encoding")]
-encoding::encoder_newtype! {
+encoding::encoder_newtype_exact! {
/// The encoder for the [`BlockTime`] type.
pub struct BlockTimeEncoder(encoding::ArrayEncoder<4>);
}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.