pub struct ProgramRef<'a> { /* private fields */ }Expand description
A verified executable program reference.
Construction validates is_executable. After construction, the
executable property is proven by the type system.
Implementations§
Source§impl<'a> ProgramRef<'a>
impl<'a> ProgramRef<'a>
Sourcepub fn from_account(account: &'a AccountView) -> Result<Self, ProgramError>
pub fn from_account(account: &'a AccountView) -> Result<Self, ProgramError>
Construct from an AccountView, validating the executable flag.
Sourcepub fn from_account_checked(
account: &'a AccountView,
expected_key: &Address,
) -> Result<Self, ProgramError>
pub fn from_account_checked( account: &'a AccountView, expected_key: &Address, ) -> Result<Self, ProgramError>
Construct and also verify the program’s address matches expected.
Sourcepub fn to_account_view(&self) -> &'a AccountView
pub fn to_account_view(&self) -> &'a AccountView
The underlying AccountView.
Auto Trait Implementations§
impl<'a> Freeze for ProgramRef<'a>
impl<'a> RefUnwindSafe for ProgramRef<'a>
impl<'a> Send for ProgramRef<'a>
impl<'a> Sync for ProgramRef<'a>
impl<'a> Unpin for ProgramRef<'a>
impl<'a> UnsafeUnpin for ProgramRef<'a>
impl<'a> UnwindSafe for ProgramRef<'a>
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