solana_accounts_db::tiered_storage::byte_block

Function read_pod

Source
pub fn read_pod<T: AnyBitPattern>(
    byte_block: &[u8],
    offset: usize,
) -> Option<&T>
Expand description

Reads the raw part of the input byte_block, at the specified offset, as type T.

Returns None if offset + size_of::() exceeds the size of the input byte_block.

Type T must be plain ol’ data to ensure no undefined behavior.