Struct solana_sdk::keyed_account::KeyedAccount
source · [−]#[repr(C)]pub struct KeyedAccount<'a> {
pub account: &'a RefCell<AccountSharedData>,
/* private fields */
}
Fields
account: &'a RefCell<AccountSharedData>
Implementations
sourceimpl<'a> KeyedAccount<'a>
impl<'a> KeyedAccount<'a>
pub fn signer_key(&self) -> Option<&Pubkey>
pub fn unsigned_key(&self) -> &Pubkey
pub fn is_writable(&self) -> bool
pub fn lamports(&self) -> Result<u64, InstructionError>
pub fn data_len(&self) -> Result<usize, InstructionError>
pub fn data_is_empty(&self) -> Result<bool, InstructionError>
pub fn owner(&self) -> Result<Pubkey, InstructionError>
pub fn executable(&self) -> Result<bool, InstructionError>
pub fn rent_epoch(&self) -> Result<Epoch, InstructionError>
pub fn try_account_ref(
&'a self
) -> Result<Ref<'_, AccountSharedData>, InstructionError>
pub fn try_account_ref_mut(
&'a self
) -> Result<RefMut<'_, AccountSharedData>, InstructionError>
pub fn new(
key: &'a Pubkey,
is_signer: bool,
account: &'a RefCell<AccountSharedData>
) -> Self
pub fn new_readonly(
key: &'a Pubkey,
is_signer: bool,
account: &'a RefCell<AccountSharedData>
) -> Self
Trait Implementations
sourceimpl<'a> Clone for KeyedAccount<'a>
impl<'a> Clone for KeyedAccount<'a>
sourcefn clone(&self) -> KeyedAccount<'a>
fn clone(&self) -> KeyedAccount<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'a> Debug for KeyedAccount<'a>
impl<'a> Debug for KeyedAccount<'a>
sourceimpl<'a> PartialEq<KeyedAccount<'a>> for KeyedAccount<'a>
impl<'a> PartialEq<KeyedAccount<'a>> for KeyedAccount<'a>
sourceimpl<'a, T> State<T> for KeyedAccount<'a> where
T: Serialize + DeserializeOwned,
impl<'a, T> State<T> for KeyedAccount<'a> where
T: Serialize + DeserializeOwned,
fn state(&self) -> Result<T, InstructionError>
fn set_state(&self, state: &T) -> Result<(), InstructionError>
Auto Trait Implementations
impl<'a> !RefUnwindSafe for KeyedAccount<'a>
impl<'a> !Send for KeyedAccount<'a>
impl<'a> !Sync for KeyedAccount<'a>
impl<'a> Unpin for KeyedAccount<'a>
impl<'a> !UnwindSafe for KeyedAccount<'a>
Blanket Implementations
sourceimpl<T> AbiExample for T
impl<T> AbiExample for T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more