MCPcopy Create free account
hub / github.com/Bonfida/dex-v4 / from_buffer_unchecked

Method from_buffer_unchecked

program/src/state.rs:241–247  ·  view source on GitHub ↗
(buf: &'a mut [u8])

Source from the content-addressed store, hash-verified

239
240 #[allow(missing_docs)]
241 pub fn from_buffer_unchecked(buf: &'a mut [u8]) -> Result<Self, ProgramError> {
242 let (hd, tl) = buf.split_at_mut(USER_ACCOUNT_HEADER_LEN);
243 let header: &mut UserAccountHeader = try_from_bytes_mut(hd).unwrap();
244 let orders = try_cast_slice_mut(tl).unwrap();
245
246 Ok(Self { header, orders })
247 }
248}
249
250impl<'a> UserAccount<'a> {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected