referrerpolicy=no-referrer-when-downgrade
frame_support::storage

Trait StorageDecodeLength

Source
pub trait StorageDecodeLength: Sealed + DecodeLength {
    // Provided method
    fn decode_len(key: &[u8]) -> Option<usize> { ... }
}
Expand description

It is expected that the length is at the beginning of the encoded object and that the length is a Compact<u32>.

This trait is sealed.

Provided Methods§

Source

fn decode_len(key: &[u8]) -> Option<usize>

Decode the length of the storage value at key.

This function assumes that the length is at the beginning of the encoded object and is a Compact<u32>.

Returns None if the storage value does not exist or the decoding failed.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T: Encode> StorageDecodeLength for Vec<T>

Implementors§