pub struct LayoutInfo {
pub disc: u8,
pub version: u8,
pub flags: u16,
pub layout_id: [u8; 8],
pub schema_epoch: u32,
pub data_len: usize,
}Expand description
Runtime metadata snapshot of an account’s layout identity.
Returned by AccountView::layout_info(). Enables manager inspection,
schema comparison, and version-aware loading without knowing the
concrete layout type at compile time.
Fields§
§disc: u8§version: u8§flags: u16§layout_id: [u8; 8]§schema_epoch: u32Schema-evolution epoch read from the header’s bytes 12..16.
A value of 0 means “legacy” (pre-audit accounts) and is
treated as equivalent to DEFAULT_SCHEMA_EPOCH when comparing
against AccountLayout::SCHEMA_EPOCH.
data_len: usizeImplementations§
Source§impl LayoutInfo
impl LayoutInfo
Sourcepub fn matches<T: LayoutContract>(&self) -> bool
pub fn matches<T: LayoutContract>(&self) -> bool
Whether this account matches the given layout contract.
Sourcepub const fn has_bytes_after(&self, offset: usize) -> bool
pub const fn has_bytes_after(&self, offset: usize) -> bool
Whether the account contains bytes beyond a given absolute offset.
Trait Implementations§
Source§impl Clone for LayoutInfo
impl Clone for LayoutInfo
Source§fn clone(&self) -> LayoutInfo
fn clone(&self) -> LayoutInfo
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 Debug for LayoutInfo
impl Debug for LayoutInfo
Source§impl PartialEq for LayoutInfo
impl PartialEq for LayoutInfo
impl Copy for LayoutInfo
impl Eq for LayoutInfo
impl StructuralPartialEq for LayoutInfo
Auto Trait Implementations§
impl Freeze for LayoutInfo
impl RefUnwindSafe for LayoutInfo
impl Send for LayoutInfo
impl Sync for LayoutInfo
impl Unpin for LayoutInfo
impl UnsafeUnpin for LayoutInfo
impl UnwindSafe for LayoutInfo
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