pub struct NftContractHostRef { /* private fields */ }Expand description
[NftContract] Host Ref.
Implementations§
Source§impl NftContractHostRef
impl NftContractHostRef
pub fn mint( &mut self, token_owner: Address, token_meta_data: String, token_hash: Maybe<String>, )
pub fn burn(&mut self, token_id: Maybe<u64>, token_hash: Maybe<String>)
pub fn register_owner(&mut self, token_owner: Maybe<Address>) -> String
pub fn transfer( &mut self, token_id: Maybe<u64>, token_hash: Maybe<String>, source_key: Address, target_key: Address, )
pub fn approve( &mut self, spender: Address, token_id: Maybe<u64>, token_hash: Maybe<String>, )
pub fn revoke(&mut self, token_id: Maybe<u64>, token_hash: Maybe<String>)
Source§impl NftContractHostRef
impl NftContractHostRef
Sourcepub fn try_mint(
&mut self,
token_owner: Address,
token_meta_data: String,
token_hash: Maybe<String>,
) -> OdraResult<()>
pub fn try_mint( &mut self, token_owner: Address, token_meta_data: String, token_hash: Maybe<String>, ) -> OdraResult<()>
Does not fail in case of error, returns odra::OdraResult instead.
Sourcepub fn try_burn(
&mut self,
token_id: Maybe<u64>,
token_hash: Maybe<String>,
) -> OdraResult<()>
pub fn try_burn( &mut self, token_id: Maybe<u64>, token_hash: Maybe<String>, ) -> OdraResult<()>
Does not fail in case of error, returns odra::OdraResult instead.
Sourcepub fn try_register_owner(
&mut self,
token_owner: Maybe<Address>,
) -> OdraResult<String>
pub fn try_register_owner( &mut self, token_owner: Maybe<Address>, ) -> OdraResult<String>
Does not fail in case of error, returns odra::OdraResult instead.
Sourcepub fn try_transfer(
&mut self,
token_id: Maybe<u64>,
token_hash: Maybe<String>,
source_key: Address,
target_key: Address,
) -> OdraResult<()>
pub fn try_transfer( &mut self, token_id: Maybe<u64>, token_hash: Maybe<String>, source_key: Address, target_key: Address, ) -> OdraResult<()>
Does not fail in case of error, returns odra::OdraResult instead.
Sourcepub fn try_approve(
&mut self,
spender: Address,
token_id: Maybe<u64>,
token_hash: Maybe<String>,
) -> OdraResult<()>
pub fn try_approve( &mut self, spender: Address, token_id: Maybe<u64>, token_hash: Maybe<String>, ) -> OdraResult<()>
Does not fail in case of error, returns odra::OdraResult instead.
Sourcepub fn try_revoke(
&mut self,
token_id: Maybe<u64>,
token_hash: Maybe<String>,
) -> OdraResult<()>
pub fn try_revoke( &mut self, token_id: Maybe<u64>, token_hash: Maybe<String>, ) -> OdraResult<()>
Does not fail in case of error, returns odra::OdraResult instead.
Trait Implementations§
Source§impl HostRef for NftContractHostRef
impl HostRef for NftContractHostRef
Source§fn new(address: Address, env: HostEnv) -> Self
fn new(address: Address, env: HostEnv) -> Self
Creates a new host side reference to a contract.
Source§fn with_tokens(&self, tokens: U512) -> Self
fn with_tokens(&self, tokens: U512) -> Self
Creates a new host reference with attached tokens, based on the current instance. Read more
Source§fn get_event<T>(&self, index: i32) -> Result<T, EventError>where
T: FromBytes + EventInstance,
fn get_event<T>(&self, index: i32) -> Result<T, EventError>where
T: FromBytes + EventInstance,
Returns the n-th event emitted by the contract. Read more
Source§fn last_call(&self) -> ContractCallResult
fn last_call(&self) -> ContractCallResult
Returns a detailed information about the last call of the contract.
Auto Trait Implementations§
impl Freeze for NftContractHostRef
impl !RefUnwindSafe for NftContractHostRef
impl !Send for NftContractHostRef
impl !Sync for NftContractHostRef
impl Unpin for NftContractHostRef
impl !UnwindSafe for NftContractHostRef
Blanket Implementations§
Source§impl<T> Addressable for Twhere
T: HostRef,
impl<T> Addressable for Twhere
T: HostRef,
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more