pub struct AccountConstraint { /* private fields */ }Expand description
A builder for constructing validation constraints on a single account.
ⓘ
AccountConstraint::on(0)
.signer()
.writable()
.owned_by_program()
.validate(&ctx)?;Implementations§
Source§impl AccountConstraint
impl AccountConstraint
Sourcepub const fn on(index: usize) -> Self
pub const fn on(index: usize) -> Self
Start building constraints for an account at the given index.
Sourcepub const fn executable(self) -> Self
pub const fn executable(self) -> Self
Require the account to be executable.
Sourcepub fn validate(&self, ctx: &ValidationContext<'_>) -> ProgramResult
pub fn validate(&self, ctx: &ValidationContext<'_>) -> ProgramResult
Validate all constraints against the context.
Auto Trait Implementations§
impl Freeze for AccountConstraint
impl RefUnwindSafe for AccountConstraint
impl Send for AccountConstraint
impl Sync for AccountConstraint
impl Unpin for AccountConstraint
impl UnsafeUnpin for AccountConstraint
impl UnwindSafe for AccountConstraint
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