pub struct TestTokenIdentifier<'a> { /* private fields */ }
Expand description
Encodes a dummy address, to be used for tests.
It is designed to be usable from contracts (especiall test contracts), with a minimal footprint. For this reason, its inner structure is subject to change.
Implementations§
Source§impl<'a> TestTokenIdentifier<'a>
impl<'a> TestTokenIdentifier<'a>
pub const fn new(name: &'a str) -> Self
pub fn eval_to_expr(&self) -> String
pub fn to_token_identifier<Api: ManagedTypeApi>(&self) -> TokenIdentifier<Api>
pub fn as_str(&self) -> &str
pub fn as_bytes(&self) -> &[u8] ⓘ
Trait Implementations§
Source§impl<Env> AnnotatedValue<Env, TokenIdentifier<<Env as TxEnv>::Api>> for TestTokenIdentifier<'_>where
Env: TxEnv,
impl<Env> AnnotatedValue<Env, TokenIdentifier<<Env as TxEnv>::Api>> for TestTokenIdentifier<'_>where
Env: TxEnv,
fn annotation(&self, _env: &Env) -> ManagedBuffer<Env::Api>
Source§fn to_value(&self, _env: &Env) -> TokenIdentifier<Env::Api>
fn to_value(&self, _env: &Env) -> TokenIdentifier<Env::Api>
Produces the value from a reference of the annotated type. Might involve a
.clone()
in some cases.Source§fn into_value(self, env: &Env) -> T
fn into_value(self, env: &Env) -> T
Consumes annotated value to produce actual value. Read more
Source§impl<'a> Clone for TestTokenIdentifier<'a>
impl<'a> Clone for TestTokenIdentifier<'a>
Source§fn clone(&self) -> TestTokenIdentifier<'a>
fn clone(&self) -> TestTokenIdentifier<'a>
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<'a> Debug for TestTokenIdentifier<'a>
impl<'a> Debug for TestTokenIdentifier<'a>
Source§impl<'a, Api> From<TestTokenIdentifier<'a>> for TokenIdentifier<Api>where
Api: ManagedTypeApi,
impl<'a, Api> From<TestTokenIdentifier<'a>> for TokenIdentifier<Api>where
Api: ManagedTypeApi,
Source§fn from(value: TestTokenIdentifier<'a>) -> Self
fn from(value: TestTokenIdentifier<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> PartialEq for TestTokenIdentifier<'a>
impl<'a> PartialEq for TestTokenIdentifier<'a>
Source§impl TopEncode for TestTokenIdentifier<'_>
impl TopEncode for TestTokenIdentifier<'_>
Source§fn top_encode_or_handle_err<O, H>(
&self,
output: O,
h: H,
) -> Result<(), H::HandledErr>where
O: TopEncodeOutput,
H: EncodeErrorHandler,
fn top_encode_or_handle_err<O, H>(
&self,
output: O,
h: H,
) -> Result<(), H::HandledErr>where
O: TopEncodeOutput,
H: EncodeErrorHandler,
Version of
top_encode
that can handle errors as soon as they occur.
For instance in can exit immediately and make sure that if it returns, it is a success.
By not deferring error handling, this can lead to somewhat smaller bytecode.Source§fn top_encode<O>(&self, output: O) -> Result<(), EncodeError>where
O: TopEncodeOutput,
fn top_encode<O>(&self, output: O) -> Result<(), EncodeError>where
O: TopEncodeOutput,
Attempt to serialize the value to ouput.
impl<'a> Copy for TestTokenIdentifier<'a>
impl<'a> Eq for TestTokenIdentifier<'a>
impl<'a> StructuralPartialEq for TestTokenIdentifier<'a>
impl<M> TypeAbiFrom<&TestTokenIdentifier<'_>> for EgldOrEsdtTokenIdentifier<M>where
M: ManagedTypeApi,
impl<M> TypeAbiFrom<TestTokenIdentifier<'_>> for EgldOrEsdtTokenIdentifier<M>where
M: ManagedTypeApi,
impl<Api> TypeAbiFrom<TestTokenIdentifier<'_>> for TokenIdentifier<Api>where
Api: ManagedTypeApi,
Auto Trait Implementations§
impl<'a> Freeze for TestTokenIdentifier<'a>
impl<'a> RefUnwindSafe for TestTokenIdentifier<'a>
impl<'a> Send for TestTokenIdentifier<'a>
impl<'a> Sync for TestTokenIdentifier<'a>
impl<'a> Unpin for TestTokenIdentifier<'a>
impl<'a> UnwindSafe for TestTokenIdentifier<'a>
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,
Source§impl<T> SCCodec for Twhere
T: TopEncode,
impl<T> SCCodec for Twhere
T: TopEncode,
fn fmt<F>(&self, f: &mut F)where
F: FormatByteReceiver,
Source§impl<T> TopEncodeMulti for Twhere
T: TopEncode,
impl<T> TopEncodeMulti for Twhere
T: TopEncode,
Source§fn multi_encode_or_handle_err<O, H>(
&self,
output: &mut O,
h: H,
) -> Result<(), <H as EncodeErrorHandler>::HandledErr>where
O: TopEncodeMultiOutput,
H: EncodeErrorHandler,
fn multi_encode_or_handle_err<O, H>(
&self,
output: &mut O,
h: H,
) -> Result<(), <H as EncodeErrorHandler>::HandledErr>where
O: TopEncodeMultiOutput,
H: EncodeErrorHandler,
Version of
top_encode
that can handle errors as soon as they occur.
For instance in can exit immediately and make sure that if it returns, it is a success.
By not deferring error handling, this can lead to somewhat smaller bytecode.Source§fn multi_encode<O>(&self, output: &mut O) -> Result<(), EncodeError>where
O: TopEncodeMultiOutput,
fn multi_encode<O>(&self, output: &mut O) -> Result<(), EncodeError>where
O: TopEncodeMultiOutput,
Attempt to serialize the value to ouput.