pub struct CompressedPathRaw {
pub byte_array_memory_manager: FieldsOffsetMaybeInPlaceByteArrayMemoryManager<u16, TrivialSizeFieldConverterU16, CompressedPathRawByteArrayMemoryManager, CompressedPathRawByteArrayMemoryManager>,
/* private fields */
}Fields§
§byte_array_memory_manager: FieldsOffsetMaybeInPlaceByteArrayMemoryManager<u16, TrivialSizeFieldConverterU16, CompressedPathRawByteArrayMemoryManager, CompressedPathRawByteArrayMemoryManager>Implementations§
Source§impl CompressedPathRaw
impl CompressedPathRaw
Sourcepub const MAX_PATH_BYTES: usize = 32_767usize
pub const MAX_PATH_BYTES: usize = 32_767usize
Maximum bytes in a compressed path / MPT key.
A byte is two nibbles and path_steps() (the nibble count) is a u16,
so a path longer than u16::MAX / 2 overflows path_size * 2 in
Self::calculate_path_steps; one over 65535 bytes also truncates the
u16 path_size, making Drop free a Layout it never allocated
(UB). Such a path can’t exist in a validly-built snapshot anyway — its
merkle would overflow path_steps on the honest builder — so capping
the receive path rejects only malformed input, not the tens-of-bytes
keys real state uses.
pub const NO_MISSING_NIBBLE: u8 = 0u8
Source§impl CompressedPathRaw
impl CompressedPathRaw
Sourcepub fn new(path_slice: &[u8], path_mask: u8) -> Self
pub fn new(path_slice: &[u8], path_mask: u8) -> Self
Create a new CompressedPathRaw from valid (path_slice, path_mask) combination.
pub fn new_and_apply_mask(path_slice: &[u8], path_mask: u8) -> Self
pub fn new_zeroed(path_size: u16, path_mask: u8) -> Self
pub const fn first_nibble_mask() -> u8
pub const fn second_nibble_mask() -> u8
pub fn from_first_nibble(x: u8) -> u8
pub fn first_nibble(x: u8) -> u8
pub fn clear_second_nibble(x: u8) -> u8
pub fn second_nibble(x: u8) -> u8
pub fn set_second_nibble(x: u8, second_nibble: u8) -> u8
pub fn has_second_nibble(path_mask: u8) -> bool
pub fn no_second_nibble(path_mask: u8) -> bool
pub fn extend_path<X: CompressedPathTrait>(x: &X, child_index: u8) -> Self
Sourcepub fn join_connected_paths<X: CompressedPathTrait, Y: CompressedPathTrait>(
x: &X,
child_index: u8,
y: &Y,
) -> Self
pub fn join_connected_paths<X: CompressedPathTrait, Y: CompressedPathTrait>( x: &X, child_index: u8, y: &Y, ) -> Self
y must be a valid path following x. i.e. when x ends with a full byte, y must be non-empty and start with nibble child_index.
Source§impl CompressedPathRaw
impl CompressedPathRaw
pub fn path_slice_mut(&mut self) -> &mut [u8] ⓘ
Trait Implementations§
Source§impl Clone for CompressedPathRaw
impl Clone for CompressedPathRaw
Source§impl Debug for CompressedPathRaw
impl Debug for CompressedPathRaw
Source§impl Decodable for CompressedPathRaw
impl Decodable for CompressedPathRaw
Source§impl Default for CompressedPathRaw
impl Default for CompressedPathRaw
Source§fn default() -> CompressedPathRaw
fn default() -> CompressedPathRaw
Source§impl<'a> Deserialize<'a> for CompressedPathRaw
impl<'a> Deserialize<'a> for CompressedPathRaw
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'a>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'a>,
Source§impl Encodable for CompressedPathRaw
impl Encodable for CompressedPathRaw
Source§fn rlp_append(&self, s: &mut RlpStream)
fn rlp_append(&self, s: &mut RlpStream)
Source§impl<'a> From<&'a [u8]> for CompressedPathRaw
impl<'a> From<&'a [u8]> for CompressedPathRaw
Source§impl Hash for CompressedPathRaw
impl Hash for CompressedPathRaw
Source§impl PartialEq for CompressedPathRaw
impl PartialEq for CompressedPathRaw
Source§impl Serialize for CompressedPathRaw
impl Serialize for CompressedPathRaw
impl Eq for CompressedPathRaw
impl Send for CompressedPathRaw
CompressedPathRaw is Send + Sync.
impl Sync for CompressedPathRaw
Auto Trait Implementations§
impl Freeze for CompressedPathRaw
impl RefUnwindSafe for CompressedPathRaw
impl Unpin for CompressedPathRaw
impl UnwindSafe for CompressedPathRaw
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ElementSatisfy<ElementNoConstrain> for T
impl<T> ElementSatisfy<ElementNoConstrain> for T
fn to_constrain_object(&self) -> &ElementNoConstrain
fn to_constrain_object_mut(&mut self) -> &mut ElementNoConstrain
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.