pub struct CEP95ReceiverHostRef { /* private fields */ }Expand description
[CEP95Receiver] Host Ref.
Implementations§
Source§impl CEP95ReceiverHostRef
impl CEP95ReceiverHostRef
Sourcepub fn on_cep95_received(
&mut self,
operator: &Address,
from: &Address,
token_id: &U256,
data: &Option<Bytes>,
) -> bool
pub fn on_cep95_received( &mut self, operator: &Address, from: &Address, token_id: &U256, data: &Option<Bytes>, ) -> bool
Called after a safe_transfer_from completes its internal state update.
MUST return true to signal acceptance; returning false or reverting
causes the entire transfer to roll back.
§Arguments
operator - The account (EOA or contract) that invoked safe_transfer_from.
from - The previous owner of token_id.
token_id - The NFT being transferred.
data - Opaque auxiliary data forwarded from the original call; may be None if no extra data was
supplied.
§Returns
true to accept the NFT, anything else to reject.
Source§impl CEP95ReceiverHostRef
impl CEP95ReceiverHostRef
Sourcepub fn try_on_cep95_received(
&mut self,
operator: &Address,
from: &Address,
token_id: &U256,
data: &Option<Bytes>,
) -> OdraResult<bool>
pub fn try_on_cep95_received( &mut self, operator: &Address, from: &Address, token_id: &U256, data: &Option<Bytes>, ) -> OdraResult<bool>
Called after a safe_transfer_from completes its internal state update.
MUST return true to signal acceptance; returning false or reverting
causes the entire transfer to roll back.
§Arguments
operator - The account (EOA or contract) that invoked safe_transfer_from.
from - The previous owner of token_id.
token_id - The NFT being transferred.
data - Opaque auxiliary data forwarded from the original call; may be None if no extra data was
supplied.
§Returns
true to accept the NFT, anything else to reject.
Does not fail in case of error, returns odra::OdraResult instead.
Trait Implementations§
Source§impl EntryPointsCallerProvider for CEP95ReceiverHostRef
impl EntryPointsCallerProvider for CEP95ReceiverHostRef
Source§fn entry_points_caller(env: &HostEnv) -> EntryPointsCaller
fn entry_points_caller(env: &HostEnv) -> EntryPointsCaller
Source§impl HasIdent for CEP95ReceiverHostRef
impl HasIdent for CEP95ReceiverHostRef
Source§impl HostRef for CEP95ReceiverHostRef
impl HostRef for CEP95ReceiverHostRef
Source§fn new(address: Address, env: HostEnv) -> Self
fn new(address: Address, env: HostEnv) -> Self
Source§fn with_tokens(&self, tokens: U512) -> Self
fn with_tokens(&self, tokens: U512) -> Self
Source§fn contract_address(&self) -> Address
fn contract_address(&self) -> Address
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,
Source§fn last_call(&self) -> ContractCallResult
fn last_call(&self) -> ContractCallResult
Auto Trait Implementations§
impl Freeze for CEP95ReceiverHostRef
impl !RefUnwindSafe for CEP95ReceiverHostRef
impl !Send for CEP95ReceiverHostRef
impl !Sync for CEP95ReceiverHostRef
impl Unpin for CEP95ReceiverHostRef
impl !UnwindSafe for CEP95ReceiverHostRef
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
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>
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>
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