#[repr(C)]pub struct Playground {
pub total_supply: Balance,
pub owner: Address,
}
Fields§
§total_supply: Balance
§owner: Address
Implementations§
Source§impl Playground
impl Playground
pub fn new( (owner_addr, owner): (&Address, &mut MaybeData<Slot>), total_supply: &Balance, ) -> Self
pub fn new_result( (owner_addr, owner): (&Address, &mut MaybeData<Slot>), total_supply: &Balance, result: &mut MaybeData<Self>, )
pub fn mint( &mut self, env: &mut Env<'_>, last_action: &mut MaybeData<LastAction>, to: &mut MaybeData<Slot>, value: &Balance, ) -> Result<(), ContractError>
pub fn balance(target: &MaybeData<Slot>) -> Balance
pub fn balance2(target: &MaybeData<Slot>, balance: &mut MaybeData<Balance>)
pub fn balance3(target: &MaybeData<Slot>, result: &mut MaybeData<Balance>)
pub fn var_bytes(_out: &mut VariableBytes<1024>)
pub fn transfer( env: &mut Env<'_>, last_action: &mut MaybeData<LastAction>, (from_address, from): (&Address, &mut MaybeData<Slot>), to: &mut MaybeData<Slot>, amount: &Balance, ) -> Result<(), ContractError>
pub fn last_action(maybe_last_action: &MaybeData<LastAction>) -> LastAction
Trait Implementations§
Source§impl Clone for Playground
impl Clone for Playground
Source§fn clone(&self) -> Playground
fn clone(&self) -> Playground
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Contract for Playground
impl Contract for Playground
Source§const MAIN_CONTRACT_METADATA: &[u8]
const MAIN_CONTRACT_METADATA: &[u8]
Main contract metadata, see
ContractMetadataKind
for encoding details. Read moreSource§type Tmp = MaybeData<LastAction>
type Tmp = MaybeData<LastAction>
Tmp type used by this contract
Source§impl Debug for Playground
impl Debug for Playground
Source§impl Fungible for Playground
impl Fungible for Playground
Source§impl TrivialType for Playgroundwhere
Balance: TrivialType,
Address: TrivialType,
impl TrivialType for Playgroundwhere
Balance: TrivialType,
Address: TrivialType,
Source§const METADATA: &[u8]
const METADATA: &[u8]
Data structure metadata in binary form, describing shape and types of the contents, see
[
IoTypeMetadataKind
] for encoding details.const SIZE: u32 = _
§unsafe fn from_bytes(bytes: &[u8]) -> Option<&Self>
unsafe fn from_bytes(bytes: &[u8]) -> Option<&Self>
Create a reference to a type, which is represented by provided memory. Read more
§unsafe fn from_bytes_mut(bytes: &mut [u8]) -> Option<&mut Self>
unsafe fn from_bytes_mut(bytes: &mut [u8]) -> Option<&mut Self>
Create a mutable reference to a type, which is represented by provided memory. Read more
§unsafe fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
unsafe fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
Access the underlying mutable byte representation of a data structure. Read more
impl ContractTrait<dyn Fungible> for Playground
impl Copy for Playground
Auto Trait Implementations§
impl Freeze for Playground
impl RefUnwindSafe for Playground
impl Send for Playground
impl Sync for Playground
impl Unpin for Playground
impl UnwindSafe for Playground
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> IoType for Twhere
T: TrivialType,
impl<T> IoType for Twhere
T: TrivialType,
§const METADATA: &'static [u8] = T::METADATA
const METADATA: &'static [u8] = T::METADATA
Data structure metadata in binary form, describing shape and types of the contents, see
IoTypeMetadataKind
for encoding details§type PointerType = T
type PointerType = T
Pointer with trivial type that this
IoType
represents§unsafe fn size_ptr(&self) -> impl Deref<Target = NonNull<u32>>
unsafe fn size_ptr(&self) -> impl Deref<Target = NonNull<u32>>
Pointer to the number of bytes that are currently used to store data. Read more
§unsafe fn size_mut_ptr(&mut self) -> impl DerefMut
unsafe fn size_mut_ptr(&mut self) -> impl DerefMut
An exclusive pointer to the number of bytes that are currently used to store data. Read more
§unsafe fn capacity_ptr(&self) -> impl Deref<Target = NonNull<u32>>
unsafe fn capacity_ptr(&self) -> impl Deref<Target = NonNull<u32>>
Number of bytes are allocated right now Read more
§unsafe fn from_ptr<'a>(
ptr: &'a NonNull<<T as IoType>::PointerType>,
size: &'a u32,
capacity: u32,
) -> impl Deref<Target = T> + 'a
unsafe fn from_ptr<'a>( ptr: &'a NonNull<<T as IoType>::PointerType>, size: &'a u32, capacity: u32, ) -> impl Deref<Target = T> + 'a
Create a reference to a type, which is represented by provided memory. Read more
§unsafe fn from_mut_ptr<'a>(
ptr: &'a mut NonNull<<T as IoType>::PointerType>,
_size: &'a mut *mut u32,
capacity: u32,
) -> impl DerefMut + 'a
unsafe fn from_mut_ptr<'a>( ptr: &'a mut NonNull<<T as IoType>::PointerType>, _size: &'a mut *mut u32, capacity: u32, ) -> impl DerefMut + 'a
Create a mutable reference to a type, which is represented by provided memory. Read more
§unsafe fn as_ptr(
&self,
) -> impl Deref<Target = NonNull<<T as IoType>::PointerType>>
unsafe fn as_ptr( &self, ) -> impl Deref<Target = NonNull<<T as IoType>::PointerType>>
Get a raw pointer to the underlying data with no checks. Read more
§unsafe fn as_mut_ptr(&mut self) -> impl DerefMut
unsafe fn as_mut_ptr(&mut self) -> impl DerefMut
Get an exclusive raw pointer to the underlying data with no checks. Read more