pub struct FieldCapability<T, const OFFSET: u32, const ROLE: u8, const POLICY: u8>where
T: Pod,{ /* private fields */ }Expand description
Zero-sized field capability: type, byte offset, semantic role, and policy.
This is the runtime half of proof-carrying field access. Macros and tooling can emit these ZSTs for each account field, then require a matching capability in higher-level mutation helpers without storing extra metadata in the account body.
Implementations§
Source§impl<T, const OFFSET: u32, const ROLE: u8, const POLICY: u8> FieldCapability<T, OFFSET, ROLE, POLICY>where
T: Pod,
impl<T, const OFFSET: u32, const ROLE: u8, const POLICY: u8> FieldCapability<T, OFFSET, ROLE, POLICY>where
T: Pod,
pub const fn new() -> FieldCapability<T, OFFSET, ROLE, POLICY>
pub const fn role() -> u8
pub const fn policy() -> u8
pub const fn typed_segment() -> TypedSegment<T, OFFSET>
pub const fn as_segment() -> Segment
pub const fn has_policy(flag: u8) -> bool
Trait Implementations§
Source§impl<T, const OFFSET: u32, const ROLE: u8, const POLICY: u8> Clone for FieldCapability<T, OFFSET, ROLE, POLICY>
impl<T, const OFFSET: u32, const ROLE: u8, const POLICY: u8> Clone for FieldCapability<T, OFFSET, ROLE, POLICY>
Source§fn clone(&self) -> FieldCapability<T, OFFSET, ROLE, POLICY>
fn clone(&self) -> FieldCapability<T, OFFSET, ROLE, POLICY>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T, const OFFSET: u32, const ROLE: u8, const POLICY: u8> Debug for FieldCapability<T, OFFSET, ROLE, POLICY>
impl<T, const OFFSET: u32, const ROLE: u8, const POLICY: u8> Debug for FieldCapability<T, OFFSET, ROLE, POLICY>
Source§impl<T, const OFFSET: u32, const ROLE: u8, const POLICY: u8> Default for FieldCapability<T, OFFSET, ROLE, POLICY>
impl<T, const OFFSET: u32, const ROLE: u8, const POLICY: u8> Default for FieldCapability<T, OFFSET, ROLE, POLICY>
Source§fn default() -> FieldCapability<T, OFFSET, ROLE, POLICY>
fn default() -> FieldCapability<T, OFFSET, ROLE, POLICY>
Returns the “default value” for a type. Read more
impl<T, const OFFSET: u32, const ROLE: u8, const POLICY: u8> Copy for FieldCapability<T, OFFSET, ROLE, POLICY>
Auto Trait Implementations§
impl<T, const OFFSET: u32, const ROLE: u8, const POLICY: u8> Freeze for FieldCapability<T, OFFSET, ROLE, POLICY>
impl<T, const OFFSET: u32, const ROLE: u8, const POLICY: u8> RefUnwindSafe for FieldCapability<T, OFFSET, ROLE, POLICY>
impl<T, const OFFSET: u32, const ROLE: u8, const POLICY: u8> Send for FieldCapability<T, OFFSET, ROLE, POLICY>
impl<T, const OFFSET: u32, const ROLE: u8, const POLICY: u8> Sync for FieldCapability<T, OFFSET, ROLE, POLICY>
impl<T, const OFFSET: u32, const ROLE: u8, const POLICY: u8> Unpin for FieldCapability<T, OFFSET, ROLE, POLICY>
impl<T, const OFFSET: u32, const ROLE: u8, const POLICY: u8> UnsafeUnpin for FieldCapability<T, OFFSET, ROLE, POLICY>
impl<T, const OFFSET: u32, const ROLE: u8, const POLICY: u8> UnwindSafe for FieldCapability<T, OFFSET, ROLE, POLICY>
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