pub struct ReturnData { /* private fields */ }Expand description
Return data from a previous CPI call.
Implementations§
Source§impl ReturnData
impl ReturnData
Sourcepub fn program_id(&self) -> &Address
pub fn program_id(&self) -> &Address
Get the program that set the return data.
Sourcepub fn as_type<T: Projectable>(&self) -> Result<&T, ProgramError>
pub fn as_type<T: Projectable>(&self) -> Result<&T, ProgramError>
Interpret the return data as a Projectable type.
Returns Err(AccountDataTooSmall) if the return data is smaller
than size_of::<T>().
Sourcepub fn as_u64(&self) -> Result<u64, ProgramError>
pub fn as_u64(&self) -> Result<u64, ProgramError>
Read a u64 from the first 8 bytes of return data.
Sourcepub fn as_u32(&self) -> Result<u32, ProgramError>
pub fn as_u32(&self) -> Result<u32, ProgramError>
Read a u32 from the first 4 bytes of return data.
Auto Trait Implementations§
impl Freeze for ReturnData
impl RefUnwindSafe for ReturnData
impl Send for ReturnData
impl Sync for ReturnData
impl Unpin for ReturnData
impl UnsafeUnpin for ReturnData
impl UnwindSafe for ReturnData
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