#[repr(C)]pub struct AccountHeader {
pub discriminator: u8,
pub version: u8,
pub flags: u16,
pub layout_id: [u8; 8],
pub reserved: [u8; 4],
}Expand description
The canonical Jiminy account header.
All fields are little-endian on wire. The struct is #[repr(C)] so
its layout matches the on-chain byte representation exactly.
Fields§
§discriminator: u8§version: u8§flags: u16§layout_id: [u8; 8]§reserved: [u8; 4]Implementations§
Source§impl AccountHeader
impl AccountHeader
Sourcepub fn from_bytes(data: &[u8]) -> Result<&Self, ProgramError>
pub fn from_bytes(data: &[u8]) -> Result<&Self, ProgramError>
Read an AccountHeader from the first 16 bytes of data.
Sourcepub fn from_bytes_mut(data: &mut [u8]) -> Result<&mut Self, ProgramError>
pub fn from_bytes_mut(data: &mut [u8]) -> Result<&mut Self, ProgramError>
Get a mutable reference to the header in data.
Trait Implementations§
Source§impl Clone for AccountHeader
impl Clone for AccountHeader
Source§fn clone(&self) -> AccountHeader
fn clone(&self) -> AccountHeader
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl FixedLayout for AccountHeader
impl FixedLayout for AccountHeader
impl Copy for AccountHeader
impl Pod for AccountHeader
Auto Trait Implementations§
impl Freeze for AccountHeader
impl RefUnwindSafe for AccountHeader
impl Send for AccountHeader
impl Sync for AccountHeader
impl Unpin for AccountHeader
impl UnsafeUnpin for AccountHeader
impl UnwindSafe for AccountHeader
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
Mutably borrows from an owned value. Read more