Skip to main content

engine_from_account_data

Function engine_from_account_data 

Source
pub fn engine_from_account_data(data: &mut [u8]) -> &mut RiskEngine
Expand description

Helper to get a mutable reference to the RiskEngine from raw account data.

SAFETY: The caller must ensure the account data is at least 8 + MarketHeader::SIZE + size_of::<RiskEngine>() bytes and properly initialized. The RiskEngine is #[repr(C)] with all-valid bit patterns.