Struct pchain_sdk::Callback
source · [−]pub struct Callback { /* private fields */ }Expand description
A struct to store return value from an entrypoint
Implementations
sourceimpl Callback
impl Callback
sourcepub fn from<T: BorshSerialize>(result: &T) -> Self
pub fn from<T: BorshSerialize>(result: &T) -> Self
Convert Borsh-serializable structure to bytes
sourcepub fn from_callback(bytes: Vec<u8>) -> Option<Vec<u8>>
pub fn from_callback(bytes: Vec<u8>) -> Option<Vec<u8>>
Convert Borsh-serialized bytes to Callback and then return the field return_val as Option of bytes
sourcepub fn return_value(&self)
pub fn return_value(&self)
Serialize the field return_val into bytes and save to transaction as return value
Trait Implementations
sourceimpl BorshDeserialize for Callback where
Vec<u8>: BorshDeserialize,
impl BorshDeserialize for Callback where
Vec<u8>: BorshDeserialize,
sourceimpl BorshSerialize for Callback where
Vec<u8>: BorshSerialize,
impl BorshSerialize for Callback where
Vec<u8>: BorshSerialize,
Auto Trait Implementations
impl RefUnwindSafe for Callback
impl Send for Callback
impl Sync for Callback
impl Unpin for Callback
impl UnwindSafe for Callback
Blanket Implementations
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