pub struct Contract { /* private fields */ }Implementations§
Source§impl Contract
impl Contract
pub fn ensure_auth_predecessor_id(&self) -> AccountId
pub fn add_public_key_and_emit_event( &mut self, account_id: &AccountIdRef, public_key: PublicKey, )
pub fn remove_public_key_and_emit_event( &mut self, account_id: &AccountIdRef, public_key: PublicKey, )
Source§impl Contract
impl Contract
Sourcepub const STATE_INIT_GAS: Gas
pub const STATE_INIT_GAS: Gas
Covers StateInit (NEP-616) cost when deterministic account doesn’t exist yet. Only accounts for deploying via Global Contract ref (NEP-591) with <770B storage which doesn’t require storage staking.
pub fn do_auth_call(signer_id: AccountId, auth_call: AuthCall) -> Promise
Source§impl Contract
impl Contract
Sourcepub fn auth_call_callback_gas(auth_call: &AuthCall) -> Option<Gas>
pub fn auth_call_callback_gas(auth_call: &AuthCall) -> Option<Gas>
Computes the static gas assigned to the do_auth_call callback.
Source§impl Contract
impl Contract
pub fn ft_resolve_deposit( &mut self, receiver_id: AccountId, contract_id: AccountId, amount: U128, ) -> PromiseOrValue<U128>
Source§impl Contract
impl Contract
pub fn do_native_withdraw(withdraw: NativeWithdraw) -> Promise
Source§impl Contract
impl Contract
pub fn do_storage_deposit(storage_deposit: StorageDeposit) -> Promise
Source§impl Contract
impl Contract
pub fn do_ft_withdraw(withdraw: FtWithdraw) -> Promise
Source§impl Contract
impl Contract
pub fn nft_resolve_deposit( &mut self, receiver_id: AccountId, contract_id: AccountId, nft_token_id: TokenId, ) -> PromiseOrValue<bool>
Source§impl Contract
impl Contract
pub fn do_nft_withdraw(withdraw: NftWithdraw) -> Promise
Source§impl Contract
impl Contract
pub fn do_mt_withdraw(withdraw: MtWithdraw) -> Promise
Source§impl Contract
impl Contract
pub fn resolve_deposit_internal<'a, I>( &mut self, receiver_id: &AccountIdRef, tokens: I, )
Source§impl Contract
impl Contract
Sourcepub fn ext(account_id: AccountId) -> ContractExt
pub fn ext(account_id: AccountId) -> ContractExt
API for calling this contract’s functions in a subsequent execution.
pub fn ext_on(promise: Promise) -> ContractExt
Source§impl Contract
impl Contract
pub fn contract_source_metadata()
Trait Implementations§
Source§impl AccessControllable for Contract
impl AccessControllable for Contract
Source§fn acl_storage_prefix() -> &'static [u8] ⓘ
fn acl_storage_prefix() -> &'static [u8] ⓘ
Returns the storage prefix for collections related to access control. By
default
b"__acl" is used. Read moreSource§fn acl_init_super_admin(&mut self, account_id: AccountId) -> bool
fn acl_init_super_admin(&mut self, account_id: AccountId) -> bool
Adds
account_id as super-admin without checking any permissions in
case there are no super-admins. If there is already a super-admin, it
has no effect. This function can be used to add a super-admin during
contract initialization. Moreover, it may provide a recovery mechanism
if (mistakenly) all super-admins have been removed. Read moreSource§fn acl_add_super_admin(&mut self, account_id: AccountId) -> Option<bool>
fn acl_add_super_admin(&mut self, account_id: AccountId) -> Option<bool>
Adds
account_id as super-admin provided that the predecessor has sufficient permissions,
i.e. is a super-admin as defined by [acl_is_super_admin]. To add the first super-admin,
[acl_init_super_admin] can be used. Read moreSource§fn acl_role_variants(&self) -> Vec<&'static str>
fn acl_role_variants(&self) -> Vec<&'static str>
Returns the names of all variants of the enum that represents roles. Read more
Source§fn acl_is_super_admin(&self, account_id: AccountId) -> bool
fn acl_is_super_admin(&self, account_id: AccountId) -> bool
Returns whether
account_id is a super-admin. A super-admin has admin
permissions for every role. However, a super-admin is not considered
grantee of any role.Source§fn acl_revoke_super_admin(&mut self, account_id: AccountId) -> Option<bool>
fn acl_revoke_super_admin(&mut self, account_id: AccountId) -> Option<bool>
Revoke super-admin permissions from
account_id provided that the
predecessor has sufficient permissions, i.e. is a super-admin as defined
by [acl_is_super_admin]. This means a super-admin may revoke
super-admin permissions from any other super-admin. Read moreSource§fn acl_transfer_super_admin(&mut self, account_id: AccountId) -> Option<bool>
fn acl_transfer_super_admin(&mut self, account_id: AccountId) -> Option<bool>
Transfer super-admin permissions from the predecessor to
account_id provided that the
predecessor has sufficient permissions, i.e. is a super-admin as defined
by [acl_is_super_admin]. This function allows a super-admin to revoke the permission from
themselves and add account_id as super-admin. While it is a helper for use cases which
require this transfer, it should be noted that AccessControllable allows having more than
one super-admin. Read moreSource§fn acl_add_admin(&mut self, role: String, account_id: AccountId) -> Option<bool>
fn acl_add_admin(&mut self, role: String, account_id: AccountId) -> Option<bool>
Makes
account_id an admin provided that the predecessor has sufficient
permissions, i.e. is an admin as defined by [acl_is_admin]. Read moreSource§fn acl_is_admin(&self, role: String, account_id: AccountId) -> bool
fn acl_is_admin(&self, role: String, account_id: AccountId) -> bool
Source§fn acl_revoke_admin(
&mut self,
role: String,
account_id: AccountId,
) -> Option<bool>
fn acl_revoke_admin( &mut self, role: String, account_id: AccountId, ) -> Option<bool>
Revokes admin permissions for
role from account_id provided that the
predecessor has sufficient permissions, i.e. is an admin as defined by
[acl_is_admin]. This means an admin for role may revoke admin
permissions from any other account that is admin for role. Read moreSource§fn acl_renounce_admin(&mut self, role: String) -> bool
fn acl_renounce_admin(&mut self, role: String) -> bool
Revokes admin permissions for
role from the predecessor. Returns
whether the predecessor was an admin for role. Read moreSource§fn acl_revoke_role(
&mut self,
role: String,
account_id: AccountId,
) -> Option<bool>
fn acl_revoke_role( &mut self, role: String, account_id: AccountId, ) -> Option<bool>
Revokes
role from account_id provided that the predecessor has
sufficient permissions, i.e. is an admin as defined by [acl_is_admin]. Read moreSource§fn acl_renounce_role(&mut self, role: String) -> bool
fn acl_renounce_role(&mut self, role: String) -> bool
Source§fn acl_grant_role(
&mut self,
role: String,
account_id: AccountId,
) -> Option<bool>
fn acl_grant_role( &mut self, role: String, account_id: AccountId, ) -> Option<bool>
Grants
role to account_id provided that the predecessor has
sufficient permissions, i.e. is an admin as defined by [acl_is_admin]. Read moreSource§fn acl_has_role(&self, role: String, account_id: AccountId) -> bool
fn acl_has_role(&self, role: String, account_id: AccountId) -> bool
Returns whether
account_id has been granted role. Note that adding
an account as (super-)admin for role does not make that account a
grantee of role. Instead, role has to be granted explicitly.Source§fn acl_has_any_role(&self, roles: Vec<String>, account_id: AccountId) -> bool
fn acl_has_any_role(&self, roles: Vec<String>, account_id: AccountId) -> bool
Returns whether
account_id has been granted any of the roles.Source§fn acl_get_super_admins(&self, skip: u64, limit: u64) -> Vec<AccountId>
fn acl_get_super_admins(&self, skip: u64, limit: u64) -> Vec<AccountId>
Enables paginated retrieval of super-admins. It returns up to
limit
super-admins and skips the first skip super-admins.Source§fn acl_get_admins(&self, role: String, skip: u64, limit: u64) -> Vec<AccountId>
fn acl_get_admins(&self, role: String, skip: u64, limit: u64) -> Vec<AccountId>
Enables paginated retrieval of admins of
role. It returns up to
limit admins and skips the first skip admins.Source§fn acl_get_grantees(
&self,
role: String,
skip: u64,
limit: u64,
) -> Vec<AccountId>
fn acl_get_grantees( &self, role: String, skip: u64, limit: u64, ) -> Vec<AccountId>
Enables paginated retrieval of grantees of
role. It returns up to
limit grantees and skips the first skip grantees.Source§fn acl_get_permissioned_accounts(&self) -> PermissionedAccounts
fn acl_get_permissioned_accounts(&self) -> PermissionedAccounts
Convenience method that returns all [
PermissionedAccounts]. Read moreSource§impl AccountManager for Contract
impl AccountManager for Contract
Source§fn has_public_key(&self, account_id: &AccountId, public_key: &PublicKey) -> bool
fn has_public_key(&self, account_id: &AccountId, public_key: &PublicKey) -> bool
Check if account has given public key
Source§fn public_keys_of(&self, account_id: &AccountId) -> HashSet<PublicKey>
fn public_keys_of(&self, account_id: &AccountId) -> HashSet<PublicKey>
Returns set of public keys registered for given account
Source§fn add_public_key(&mut self, public_key: PublicKey)
fn add_public_key(&mut self, public_key: PublicKey)
Registers or re-activates
public_key under the caller account_id. Read moreSource§fn remove_public_key(&mut self, public_key: PublicKey)
fn remove_public_key(&mut self, public_key: PublicKey)
Deactivate
public_key from the caller account_id,
i.e. this key can’t be used to make any actions unless it’s re-created. Read moreSource§fn is_nonce_used(&self, account_id: &AccountId, nonce: AsBase64<Nonce>) -> bool
fn is_nonce_used(&self, account_id: &AccountId, nonce: AsBase64<Nonce>) -> bool
Returns whether given nonce was already used by the account
NOTE: nonces are non-sequential and follow
permit2 nonce schema.
Source§fn is_auth_by_predecessor_id_enabled(&self, account_id: &AccountId) -> bool
fn is_auth_by_predecessor_id_enabled(&self, account_id: &AccountId) -> bool
Returns whether authentication by PREDECESSOR_ID is enabled
for given
account_id. Read moreSource§fn disable_auth_by_predecessor_id(&mut self)
fn disable_auth_by_predecessor_id(&mut self)
Disables authentication by PREDECESSOR_ID for the caller,
i.e. PREDECESSOR_ID itself. Read more
Source§impl BorshDeserialize for Contract
impl BorshDeserialize for Contract
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl ContractState for Contract
impl ContractState for Contract
fn state_key() -> &'static [u8] ⓘ
fn state_exists() -> bool
fn state_read() -> Option<Self>where
Self: BorshDeserialize,
fn state_write(&self) -> boolwhere
Self: BorshSerialize,
Source§impl ControllerUpgradable for Contract
impl ControllerUpgradable for Contract
Source§impl FeesManager for Contract
impl FeesManager for Contract
Source§impl ForceAccountManager for Contract
impl ForceAccountManager for Contract
Source§fn is_account_locked(&self, account_id: &AccountId) -> bool
fn is_account_locked(&self, account_id: &AccountId) -> bool
Returns whether the given
account_id is lockedSource§fn force_lock_account(&mut self, account_id: AccountId) -> bool
fn force_lock_account(&mut self, account_id: AccountId) -> bool
Locks given
account_id from modifying its own state, including
token balances.
Returns false if the account was already in locked state. Read moreSource§fn force_unlock_account(&mut self, account_id: &AccountId) -> bool
fn force_unlock_account(&mut self, account_id: &AccountId) -> bool
Source§fn force_disable_auth_by_predecessor_ids(&mut self, account_ids: Vec<AccountId>)
fn force_disable_auth_by_predecessor_ids(&mut self, account_ids: Vec<AccountId>)
Disables authentication by PREDECESSOR_ID for given account ids. Read more
Source§fn force_enable_auth_by_predecessor_ids(&mut self, account_ids: Vec<AccountId>)
fn force_enable_auth_by_predecessor_ids(&mut self, account_ids: Vec<AccountId>)
Enables authentication by PREDECESSOR_ID for given account ids. Read more
Source§impl FullAccessKeys for Contract
impl FullAccessKeys for Contract
fn add_full_access_key(&mut self, public_key: PublicKey) -> Promise
fn delete_key(&mut self, public_key: PublicKey) -> Promise
Source§impl FungibleTokenReceiver for Contract
impl FungibleTokenReceiver for Contract
Source§fn ft_on_transfer(
&mut self,
sender_id: AccountId,
amount: U128,
msg: String,
) -> PromiseOrValue<U128>
fn ft_on_transfer( &mut self, sender_id: AccountId, amount: U128, msg: String, ) -> PromiseOrValue<U128>
Deposit fungible tokens.
msg contains [AccountId] of the internal recipient.
Empty msg means deposit to sender_id
Source§impl FungibleTokenWithdrawResolver for Contract
impl FungibleTokenWithdrawResolver for Contract
fn ft_resolve_withdraw( &mut self, token: AccountId, sender_id: AccountId, amount: U128, is_call: bool, ) -> U128
Source§impl FungibleTokenWithdrawer for Contract
impl FungibleTokenWithdrawer for Contract
Source§impl GarbageCollector for Contract
impl GarbageCollector for Contract
Source§impl Intents for Contract
impl Intents for Contract
fn execute_intents(&mut self, signed: Vec<MultiPayload>)
fn simulate_intents(&self, signed: Vec<MultiPayload>) -> SimulationOutput
Source§impl MultiTokenCore for Contract
impl MultiTokenCore for Contract
fn mt_transfer( &mut self, receiver_id: AccountId, token_id: TokenId, amount: U128, approval: Option<(AccountId, u64)>, memo: Option<String>, )
fn mt_batch_transfer( &mut self, receiver_id: AccountId, token_ids: Vec<TokenId>, amounts: Vec<U128>, approvals: Option<Vec<Option<(AccountId, u64)>>>, memo: Option<String>, )
fn mt_transfer_call( &mut self, receiver_id: AccountId, token_id: TokenId, amount: U128, approval: Option<(AccountId, u64)>, memo: Option<String>, msg: String, ) -> PromiseOrValue<Vec<U128>>
fn mt_batch_transfer_call( &mut self, receiver_id: AccountId, token_ids: Vec<TokenId>, amounts: Vec<U128>, approvals: Option<Vec<Option<(AccountId, u64)>>>, memo: Option<String>, msg: String, ) -> PromiseOrValue<Vec<U128>>
fn mt_token(&self, token_ids: Vec<TokenId>) -> Vec<Option<Token>>
fn mt_balance_of(&self, account_id: AccountId, token_id: TokenId) -> U128
fn mt_batch_balance_of( &self, account_id: AccountId, token_ids: Vec<TokenId>, ) -> Vec<U128>
fn mt_supply(&self, token_id: TokenId) -> Option<U128>
fn mt_batch_supply(&self, token_ids: Vec<TokenId>) -> Vec<Option<U128>>
Source§impl MultiTokenEnumeration for Contract
impl MultiTokenEnumeration for Contract
Source§impl MultiTokenForcedCore for Contract
impl MultiTokenForcedCore for Contract
fn mt_force_transfer( &mut self, owner_id: AccountId, receiver_id: AccountId, token_id: TokenId, amount: U128, approval: Option<(AccountId, u64)>, memo: Option<String>, )
fn mt_force_batch_transfer( &mut self, owner_id: AccountId, receiver_id: AccountId, token_ids: Vec<TokenId>, amounts: Vec<U128>, approvals: Option<Vec<Option<(AccountId, u64)>>>, memo: Option<String>, )
fn mt_force_transfer_call( &mut self, owner_id: AccountId, receiver_id: AccountId, token_id: TokenId, amount: U128, approval: Option<(AccountId, u64)>, memo: Option<String>, msg: String, ) -> PromiseOrValue<Vec<U128>>
fn mt_force_batch_transfer_call( &mut self, owner_id: AccountId, receiver_id: AccountId, token_ids: Vec<TokenId>, amounts: Vec<U128>, approvals: Option<Vec<Option<(AccountId, u64)>>>, memo: Option<String>, msg: String, ) -> PromiseOrValue<Vec<U128>>
Source§impl MultiTokenReceiver for Contract
impl MultiTokenReceiver for Contract
Source§impl MultiTokenResolver for Contract
impl MultiTokenResolver for Contract
Source§impl MultiTokenWithdrawer for Contract
impl MultiTokenWithdrawer for Contract
Source§impl NonFungibleTokenReceiver for Contract
impl NonFungibleTokenReceiver for Contract
Source§fn nft_on_transfer(
&mut self,
sender_id: AccountId,
previous_owner_id: AccountId,
token_id: TokenId,
msg: String,
) -> PromiseOrValue<bool>
fn nft_on_transfer( &mut self, sender_id: AccountId, previous_owner_id: AccountId, token_id: TokenId, msg: String, ) -> PromiseOrValue<bool>
Deposit non-fungible token.
msg contains [AccountId] of the internal recipient.
Empty msg means deposit to sender_id
Source§impl NonFungibleTokenWithdrawResolver for Contract
impl NonFungibleTokenWithdrawResolver for Contract
fn nft_resolve_withdraw( &mut self, token: AccountId, sender_id: AccountId, token_id: TokenId, is_call: bool, ) -> bool
Source§impl Pausable for Contract
impl Pausable for Contract
Source§fn pa_storage_key(&self) -> &'static [u8] ⓘ
fn pa_storage_key(&self) -> &'static [u8] ⓘ
Returns the key of the storage slot which contains the list of features that are paused. By
default
b"__PAUSED__" is used. Read moreSource§fn pa_is_paused(&self, key: String) -> bool
fn pa_is_paused(&self, key: String) -> bool
Returns whether feature
key is paused.Source§fn pa_all_paused(&self) -> Option<HashSet<String>>
fn pa_all_paused(&self) -> Option<HashSet<String>>
Returns all features that are currently paused.
Source§impl RelayerKeys for Contract
impl RelayerKeys for Contract
Source§fn add_relayer_key(&mut self, public_key: PublicKey) -> Promise
fn add_relayer_key(&mut self, public_key: PublicKey) -> Promise
Adds access key for calling
execute_signed_intents
with allowance passed as attached deposit via #[payable]
NOTE: requires 1yN for security purposesfn do_add_relayer_key(&mut self, public_key: PublicKey)
Source§fn delete_relayer_key(&mut self, public_key: PublicKey) -> Promise
fn delete_relayer_key(&mut self, public_key: PublicKey) -> Promise
NOTE: requires 1yN for security purposes
Source§impl SaltManager for Contract
impl SaltManager for Contract
Source§fn update_current_salt(&mut self) -> Salt
fn update_current_salt(&mut self) -> Salt
Sets the current salt to a new one, previous salt remains valid.
Returns the new current salt.
Source§fn invalidate_salts(&mut self, salts: Vec<Salt>) -> Salt
fn invalidate_salts(&mut self, salts: Vec<Salt>) -> Salt
Invalidates the provided salt: invalidates provided salt,
sets a new one if it was current salt.
Returns the current salt.
Source§fn is_valid_salt(&self, salt: Salt) -> bool
fn is_valid_salt(&self, salt: Salt) -> bool
Returns whether the provided salt is valid
Source§fn current_salt(&self) -> Salt
fn current_salt(&self) -> Salt
Returns the current salt
Source§impl State for Contract
impl State for Contract
fn add_public_key( &mut self, account_id: AccountId, public_key: PublicKey, ) -> Result<()>
fn remove_public_key( &mut self, account_id: AccountId, public_key: PublicKey, ) -> Result<()>
fn commit_nonce(&mut self, account_id: AccountId, nonce: Nonce) -> Result<()>
fn cleanup_nonce_by_prefix( &mut self, account_id: &AccountIdRef, prefix: NoncePrefix, ) -> Result<bool>
fn internal_add_balance( &mut self, owner_id: AccountId, tokens: impl IntoIterator<Item = (TokenId, u128)>, ) -> Result<()>
fn internal_sub_balance( &mut self, owner_id: &AccountIdRef, tokens: impl IntoIterator<Item = (TokenId, u128)>, ) -> Result<()>
fn ft_withdraw( &mut self, owner_id: &AccountIdRef, withdraw: FtWithdraw, ) -> Result<()>
fn nft_withdraw( &mut self, owner_id: &AccountIdRef, withdraw: NftWithdraw, ) -> Result<()>
fn mt_withdraw( &mut self, owner_id: &AccountIdRef, withdraw: MtWithdraw, ) -> Result<()>
fn native_withdraw( &mut self, owner_id: &AccountIdRef, withdraw: NativeWithdraw, ) -> Result<()>
fn notify_on_transfer( &self, sender_id: &AccountIdRef, receiver_id: AccountId, tokens: Amounts, notification: NotifyOnTransfer, )
fn storage_deposit( &mut self, owner_id: &AccountIdRef, storage_deposit: StorageDeposit, ) -> Result<()>
Source§fn set_auth_by_predecessor_id(
&mut self,
account_id: AccountId,
enable: bool,
) -> Result<bool>
fn set_auth_by_predecessor_id( &mut self, account_id: AccountId, enable: bool, ) -> Result<bool>
Sets whether authentication by
PREDECESSOR_ID is enabled.
Returns whether authentication by PREDECESSOR_ID was enabled
before.fn auth_call( &mut self, signer_id: &AccountIdRef, auth_call: AuthCall, ) -> Result<()>
fn mint( &mut self, owner_id: AccountId, tokens: Amounts, memo: Option<String>, ) -> Result<()>
fn burn( &mut self, owner_id: &AccountIdRef, tokens: Amounts, memo: Option<String>, ) -> Result<()>
fn internal_apply_deltas( &mut self, owner_id: &AccountIdRef, tokens: impl IntoIterator<Item = (TokenId, i128)>, ) -> Result<(), DefuseError>
fn imt_mint( &mut self, minter_id: &AccountIdRef, receiver_id: AccountId, tokens: Amounts<BTreeMap<String, u128>>, memo: Option<String>, notification: Option<NotifyOnTransfer>, ) -> Result<(), DefuseError>
fn imt_burn( &mut self, owner_id: &AccountIdRef, minter_id: &AccountIdRef, tokens: Amounts<BTreeMap<String, u128>>, memo: Option<String>, ) -> Result<(), DefuseError>
Source§impl StateView for Contract
impl StateView for Contract
fn verifying_contract(&self) -> Cow<'_, AccountIdRef>
fn wnear_id(&self) -> Cow<'_, AccountIdRef>
fn fee(&self) -> Pips
fn fee_collector(&self) -> Cow<'_, AccountIdRef>
fn has_public_key( &self, account_id: &AccountIdRef, public_key: &PublicKey, ) -> bool
fn iter_public_keys( &self, account_id: &AccountIdRef, ) -> impl Iterator<Item = PublicKey> + '_
fn is_nonce_used(&self, account_id: &AccountIdRef, nonce: Nonce) -> bool
fn balance_of(&self, account_id: &AccountIdRef, token_id: &TokenId) -> u128
fn is_account_locked(&self, account_id: &AccountIdRef) -> bool
Source§fn is_auth_by_predecessor_id_enabled(&self, account_id: &AccountIdRef) -> bool
fn is_auth_by_predecessor_id_enabled(&self, account_id: &AccountIdRef) -> bool
Returns whether authentication by
PREDECESSOR_ID is enabled.Source§fn is_valid_salt(&self, salt: Salt) -> bool
fn is_valid_salt(&self, salt: Salt) -> bool
Returns whether salt in nonce is valid
fn wnear_token_id(&self) -> TokenId
fn cached(self) -> CachedState<Self>where
Self: Sized,
impl Defuse for Contract
Auto Trait Implementations§
impl !Freeze for Contract
impl !RefUnwindSafe for Contract
impl Send for Contract
impl !Sync for Contract
impl Unpin for Contract
impl !UnwindSafe for Contract
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
Casts
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more§impl<T> BitPackWrapAsExt for T
impl<T> BitPackWrapAsExt for T
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
§impl<T> CellSerializeWrapAsExt for T
impl<T> CellSerializeWrapAsExt for T
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
Causes
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
Causes
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
Causes
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
Causes
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
Causes
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
Causes
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
Formats each item in a sequence. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 moreSource§impl<E> PanicError for E
impl<E> PanicError for E
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self, then passes self.deref() into the pipe function.§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref() only in debug builds, and is erased in release
builds.