#[repr(C)]pub struct StateCompareAndWriteArgs {
pub state_ptr: NonNull<Address>,
pub old_state_ptr: NonNull<<VariableBytes<RECOMMENDED_STATE_CAPACITY> as IoType>::PointerType>,
pub old_state_size: NonNull<u32>,
pub new_state_ptr: NonNull<<VariableBytes<RECOMMENDED_STATE_CAPACITY> as IoType>::PointerType>,
pub new_state_size: NonNull<u32>,
pub ok_result_ptr: NonNull<bool>,
pub ok_result_size: *mut u32,
pub ok_result_capacity: NonNull<u32>,
}
Expand description
Data structure containing expected input for external method invocation, eventually calling state_compare_and_write()
on the other side by the host.
This can be used with Env
, though there are helper methods on this provided by extension trait that allow not dealing with this struct directly in simpler cases.
Fields§
§state_ptr: NonNull<Address>
§old_state_ptr: NonNull<<VariableBytes<RECOMMENDED_STATE_CAPACITY> as IoType>::PointerType>
§old_state_size: NonNull<u32>
Size of the contents old_state_ptr
points to
new_state_ptr: NonNull<<VariableBytes<RECOMMENDED_STATE_CAPACITY> as IoType>::PointerType>
§new_state_size: NonNull<u32>
Size of the contents new_state_ptr
points to
ok_result_ptr: NonNull<bool>
§ok_result_size: *mut u32
Size of the contents ok_result_ptr
points to
ok_result_capacity: NonNull<u32>
Capacity of the allocated memory ok_result_ptr
points to
Implementations§
Source§impl StateCompareAndWriteArgs
impl StateCompareAndWriteArgs
Sourcepub fn new(
state: &Address,
old_state: &VariableBytes<RECOMMENDED_STATE_CAPACITY>,
new_state: &VariableBytes<RECOMMENDED_STATE_CAPACITY>,
ok_result: &mut MaybeUninit<bool>,
ok_result_size: &mut u32,
) -> Self
pub fn new( state: &Address, old_state: &VariableBytes<RECOMMENDED_STATE_CAPACITY>, new_state: &VariableBytes<RECOMMENDED_STATE_CAPACITY>, ok_result: &mut MaybeUninit<bool>, ok_result_size: &mut u32, ) -> Self
Create a new instance
Trait Implementations§
Source§impl Debug for StateCompareAndWriteArgs
impl Debug for StateCompareAndWriteArgs
Source§impl ExternalArgs for StateCompareAndWriteArgs
impl ExternalArgs for StateCompareAndWriteArgs
Auto Trait Implementations§
impl Freeze for StateCompareAndWriteArgs
impl RefUnwindSafe for StateCompareAndWriteArgs
impl !Send for StateCompareAndWriteArgs
impl !Sync for StateCompareAndWriteArgs
impl Unpin for StateCompareAndWriteArgs
impl UnwindSafe for StateCompareAndWriteArgs
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