mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
docs: note about type changes (#11925)
This commit is contained in:
@ -48,6 +48,12 @@ pub mod test_utils;
|
||||
/// Regarding the `specialized_to/from_compact` methods: Mainly used as a workaround for not being
|
||||
/// able to specialize an impl over certain types like `Vec<T>`/`Option<T>` where `T` is a fixed
|
||||
/// size array like `Vec<B256>`.
|
||||
///
|
||||
/// ## Caution
|
||||
///
|
||||
/// Due to the bitfields, every type change on the rust type (e.g. `U256` to `u64`) is a breaking
|
||||
/// change and will lead to a new, incompatible [`Compact`] implementation. Implementers must take
|
||||
/// special care when changing or rearranging fields.
|
||||
pub trait Compact: Sized {
|
||||
/// Takes a buffer which can be written to. *Ideally*, it returns the length written to.
|
||||
fn to_compact<B>(&self, buf: &mut B) -> usize
|
||||
|
||||
Reference in New Issue
Block a user