pub struct Contract {
pub market: Market,
/* private fields */
}Fields§
§market: MarketImplementations§
Source§impl Contract
Internal helpers.
impl Contract
Internal helpers.
pub fn retrieve_price_pair(&self) -> Promise
pub fn price_pair(&self, oracle_response: OracleResponse) -> PricePair
pub fn execute_supply( &mut self, account_id: AccountId, amount: BorrowAssetAmount, )
pub fn execute_collateralize( &mut self, account_id: AccountId, amount: CollateralAssetAmount, price_pair: &PricePair, )
Sourcepub fn execute_repay(
&mut self,
account_id: AccountId,
amount: BorrowAssetAmount,
price_pair: &PricePair,
) -> BorrowAssetAmount
pub fn execute_repay( &mut self, account_id: AccountId, amount: BorrowAssetAmount, price_pair: &PricePair, ) -> BorrowAssetAmount
Returns the amount that should be returned to the account.
Source§impl Contract
External helpers.
impl Contract
External helpers.
pub const GAS_BORROW_01_CONSUME_PRICE: Gas
pub const GAS_BORROW_02_FINALIZE: Gas
pub const GAS_EXECUTE_NEXT_SUPPLY_WITHDRAWAL_REQUEST_01_FINALIZE: Gas
pub const GAS_COLLATERALIZE_TRANSFER_CALL_01_CONSUME_PRICE: Gas
pub const GAS_REPAY_TRANSFER_CALL_01_CONSUME_PRICE: Gas
pub const GAS_LIQUIDATE_TRANSFER_CALL_01_CONSUME_PRICE: Gas
pub const GAS_LIQUIDATE_TRANSFER_CALL_02_FINALIZE: Gas
pub const GAS_WITHDRAW_COLLATERAL_01_CONSUME_PRICE: Gas
pub const GAS_WITHDRAW_COLLATERAL_02_FINALIZE: Gas
pub const GAS_WITHDRAW_STATIC_YIELD_01_FINALIZE: Gas
pub fn borrow_01_consume_price( &mut self, account_id: AccountId, amount: BorrowAssetAmount, oracle_response: OracleResponse, ) -> Promise
pub fn borrow_02_finalize( &mut self, account_id: AccountId, initial_borrow: InitialBorrow, )
pub fn execute_next_supply_withdrawal_request_01_finalize( &mut self, resolutions: Vec<Withdrawal>, result: WithdrawalQueueExecutionResult, ) -> WithdrawalQueueExecutionResult
pub fn collateralize_transfer_call_01_consume_price( &mut self, account_id: AccountId, amount: CollateralAssetAmount, return_style: ReturnStyle, oracle_response: OracleResponse, ) -> Value
pub fn repay_transfer_call_01_consume_price( &mut self, account_id: AccountId, amount: BorrowAssetAmount, return_style: ReturnStyle, oracle_response: OracleResponse, ) -> Value
pub fn liquidate_transfer_call_01_consume_price( &mut self, liquidator_id: AccountId, amount: BorrowAssetAmount, msg: LiquidateMsg, return_style: ReturnStyle, oracle_response: OracleResponse, ) -> Promise
Sourcepub fn liquidate_transfer_call_02_finalize(
&mut self,
refund: BorrowAssetAmount,
return_style: ReturnStyle,
) -> Value
pub fn liquidate_transfer_call_02_finalize( &mut self, refund: BorrowAssetAmount, return_style: ReturnStyle, ) -> Value
Called during liquidation process; checks whether the transfer of collateral to the liquidator was successful.
pub fn withdraw_collateral_01_consume_price( &mut self, account_id: AccountId, amount: CollateralAssetAmount, oracle_response: OracleResponse, ) -> Promise
pub fn withdraw_collateral_02_finalize( &mut self, account_id: AccountId, amount: CollateralAssetAmount, )
pub fn withdraw_static_yield_01_finalize( &mut self, account_id: AccountId, amount: BorrowAssetAmount, )
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
Sourcepub fn ext_self() -> ContractExt
pub fn ext_self() -> ContractExt
Convenience method for creating a cross-contract call to the current contract.
Equivalent to Self::ext(near_sdk::env::current_account_id()).
Source§impl Contract
impl Contract
pub fn contract_source_metadata()
Methods from Deref<Target = Market>§
pub fn borrowed(&self) -> FungibleAssetAmount<BorrowAsset>
pub fn total_incoming(&self) -> FungibleAssetAmount<BorrowAsset>
pub fn incoming_at( &self, snapshot_index: u32, ) -> FungibleAssetAmount<BorrowAsset>
pub fn get_last_finalized_snapshot(&self) -> &Snapshot
pub fn current_snapshot(&self) -> Snapshot
pub fn snapshot(&mut self) -> SnapshotProof
pub fn single_snapshot_fee( &self, amount: FungibleAssetAmount<BorrowAsset>, ) -> Option<FungibleAssetAmount<BorrowAsset>>
pub fn interest_rate(&self) -> Decimal
pub fn get_borrow_asset_available_to_borrow( &self, ) -> FungibleAssetAmount<BorrowAsset>
pub fn iter_supply_positions( &self, ) -> impl Iterator<Item = (AccountId, SupplyPosition)>
pub fn supply_position_ref( &self, account_id: AccountId, ) -> Option<SupplyPositionRef<&Market>>
pub fn supply_position_guard( &mut self, _proof: SnapshotProof, account_id: AccountId, ) -> Option<SupplyPositionGuard<'_>>
pub fn get_or_create_supply_position_guard( &mut self, _proof: SnapshotProof, account_id: AccountId, ) -> SupplyPositionGuard<'_>
pub fn cleanup_supply_position(&mut self, account_id: &AccountId) -> bool
pub fn iter_borrow_positions( &self, ) -> impl Iterator<Item = (AccountId, BorrowPosition)>
pub fn borrow_position_ref( &self, account_id: AccountId, ) -> Option<BorrowPositionRef<&Market>>
pub fn borrow_position_guard( &mut self, _proof: SnapshotProof, account_id: AccountId, ) -> Option<BorrowPositionGuard<'_>>
pub fn get_or_create_borrow_position_guard( &mut self, _proof: SnapshotProof, account_id: AccountId, ) -> BorrowPositionGuard<'_>
pub fn cleanup_borrow_position(&mut self, account_id: &AccountId) -> bool
pub fn record_borrow_asset_protocol_yield( &mut self, amount: FungibleAssetAmount<BorrowAsset>, )
pub fn record_borrow_asset_yield_distribution( &mut self, amount: FungibleAssetAmount<BorrowAsset>, )
pub fn accumulate_static_yield(
&mut self,
account_id: &AccountId,
snapshot_limit: u32,
) -> Result<(), UnknownAccount>
pub fn accumulate_static_yield( &mut self, account_id: &AccountId, snapshot_limit: u32, ) -> Result<(), UnknownAccount>
Accumulate static yield for an account.
§Errors
- When the account is not configured to earn static yield.
Trait Implementations§
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 BorshSchema for Contract
impl BorshSchema for Contract
Source§fn declaration() -> Declaration
fn declaration() -> Declaration
Get the name of the type without brackets.
Source§fn add_definitions_recursively(
definitions: &mut BTreeMap<Declaration, Definition>,
)
fn add_definitions_recursively( definitions: &mut BTreeMap<Declaration, Definition>, )
Recursively, using DFS, add type definitions required for this type.
Type definition partially explains how to serialize/deserialize a type.
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 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>
Called by fungible token contract after
ft_transfer_call was initiated by
sender_id of the given amount with the transfer message given in msg field.
The amount of tokens were already transferred to this contract account and ready to be used. Read moreSource§impl MarketExternalInterface for Contract
impl MarketExternalInterface for Contract
Source§fn create_supply_withdrawal_request(&mut self, amount: BorrowAssetAmount)
fn create_supply_withdrawal_request(&mut self, amount: BorrowAssetAmount)
If the predecessor has already entered the queue, calling this function will reset the position to the back of the queue.
Source§fn get_configuration(&self) -> MarketConfiguration
fn get_configuration(&self) -> MarketConfiguration
Retrieve the market configuration.
Source§fn get_current_snapshot(&self) -> Snapshot
fn get_current_snapshot(&self) -> Snapshot
Retrieve the current snapshot (in progress; not yet finalized).
Source§fn get_finalized_snapshots_len(&self) -> u32
fn get_finalized_snapshots_len(&self) -> u32
Retrieve the count of finalized snapshots.
Source§fn get_borrow_asset_metrics(&self) -> BorrowAssetMetrics
fn get_borrow_asset_metrics(&self) -> BorrowAssetMetrics
Retrieve current contract metrics about borrow asset deposit,
availability, usage, etc.
Source§fn list_borrow_positions(
&self,
offset: Option<u32>,
count: Option<u32>,
) -> HashMap<AccountId, BorrowPosition>
fn list_borrow_positions( &self, offset: Option<u32>, count: Option<u32>, ) -> HashMap<AccountId, BorrowPosition>
Retrieve a map of borrow positions.
Source§fn list_finalized_snapshots(
&self,
offset: Option<u32>,
count: Option<u32>,
) -> Vec<&Snapshot>
fn list_finalized_snapshots( &self, offset: Option<u32>, count: Option<u32>, ) -> Vec<&Snapshot>
Retrieve a list of finalized snapshots.
Source§fn list_supply_positions(
&self,
offset: Option<u32>,
count: Option<u32>,
) -> HashMap<AccountId, SupplyPosition>
fn list_supply_positions( &self, offset: Option<u32>, count: Option<u32>, ) -> HashMap<AccountId, SupplyPosition>
Retrieves a set of supply positions.
Source§fn get_borrow_position(&self, account_id: AccountId) -> Option<BorrowPosition>
fn get_borrow_position(&self, account_id: AccountId) -> Option<BorrowPosition>
Retrieve a specific borrow position, with estimated fees. Read more
Source§fn get_borrow_position_pending_interest(
&self,
account_id: AccountId,
snapshot_limit: Option<u32>,
) -> Option<BorrowAssetAmount>
fn get_borrow_position_pending_interest( &self, account_id: AccountId, snapshot_limit: Option<u32>, ) -> Option<BorrowAssetAmount>
Estimate the pending interest on the borrow position, that is, the
amount of interest that would accrue on the record if an accumulation
were to be run. Read more
Source§fn get_borrow_status(
&self,
account_id: AccountId,
oracle_response: OracleResponse,
) -> Option<BorrowStatus>
fn get_borrow_status( &self, account_id: AccountId, oracle_response: OracleResponse, ) -> Option<BorrowStatus>
Retrieves the status of a borrow position (healthy or in liquidation)
given some asset prices. Read more
Source§fn borrow(&mut self, amount: BorrowAssetAmount) -> Promise
fn borrow(&mut self, amount: BorrowAssetAmount) -> Promise
Transfers
amount of borrow asset tokens to the caller, provided
their borrow position will still be sufficiently collateralized.Source§fn withdraw_collateral(&mut self, amount: CollateralAssetAmount) -> Promise
fn withdraw_collateral(&mut self, amount: CollateralAssetAmount) -> Promise
Transfers
amount of collateral asset tokens to the caller, provided
their borrow position will still be sufficiently collateralized.Source§fn apply_interest(
&mut self,
account_id: Option<AccountId>,
snapshot_limit: Option<u32>,
)
fn apply_interest( &mut self, account_id: Option<AccountId>, snapshot_limit: Option<u32>, )
Applies interest to the predecessor’s borrow record.
Not likely to be used in real life, since there it does not affect the
final interest calculation, and rounds fractional interest UP.
Source§fn get_supply_position(&self, account_id: AccountId) -> Option<SupplyPosition>
fn get_supply_position(&self, account_id: AccountId) -> Option<SupplyPosition>
Retrieves a supply position record, with estimated yield. Read more
fn get_supply_position_pending_yield( &self, account_id: AccountId, snapshot_limit: Option<u32>, ) -> Option<BorrowAssetAmount>
Source§fn cancel_supply_withdrawal_request(&mut self)
fn cancel_supply_withdrawal_request(&mut self)
Removes a supply position from the withdrawal queue.
Source§fn execute_next_supply_withdrawal_request(
&mut self,
batch_limit: Option<u32>,
) -> PromiseOrValue<WithdrawalQueueExecutionResult>
fn execute_next_supply_withdrawal_request( &mut self, batch_limit: Option<u32>, ) -> PromiseOrValue<WithdrawalQueueExecutionResult>
Attempts to fulfill the first withdrawal request in the queue.
Source§fn get_supply_withdrawal_request_status(
&self,
account_id: AccountId,
) -> Option<WithdrawalRequestStatus>
fn get_supply_withdrawal_request_status( &self, account_id: AccountId, ) -> Option<WithdrawalRequestStatus>
Retrieves the status of a withdrawal request in the queue.
Source§fn get_supply_withdrawal_queue_status(&self) -> WithdrawalQueueStatus
fn get_supply_withdrawal_queue_status(&self) -> WithdrawalQueueStatus
Retrieves the status of the withdrawal queue.
Source§fn harvest_yield(
&mut self,
account_id: Option<AccountId>,
mode: Option<HarvestYieldMode>,
) -> BorrowAssetAmount
fn harvest_yield( &mut self, account_id: Option<AccountId>, mode: Option<HarvestYieldMode>, ) -> BorrowAssetAmount
Claim any distributed yield to the supply record.
Source§fn get_last_yield_rate(&self) -> Decimal
fn get_last_yield_rate(&self) -> Decimal
This value is an expected average over time.
Supply positions actually earn all of their yield the instant it is
distributed.
Source§fn get_static_yield(
&self,
account_id: AccountId,
) -> Option<Accumulator<BorrowAsset>>
fn get_static_yield( &self, account_id: AccountId, ) -> Option<Accumulator<BorrowAsset>>
Retrieves the amount of yield earned by an account statically
configured to earn yield (e.g. [
MarketConfiguration::yield_weights]
or [MarketConfiguration::protocol_account_id]).Source§fn accumulate_static_yield(
&mut self,
account_id: Option<AccountId>,
snapshot_limit: Option<u32>,
)
fn accumulate_static_yield( &mut self, account_id: Option<AccountId>, snapshot_limit: Option<u32>, )
Accumulates yield for an account that earns static yield.
Source§fn withdraw_static_yield(
&mut self,
amount: Option<BorrowAssetAmount>,
) -> Promise
fn withdraw_static_yield( &mut self, amount: Option<BorrowAssetAmount>, ) -> Promise
Attempts to withdraw the amount of yield earned by an account
statically configured to earn yield (e.g.
[
MarketConfiguration::yield_weights] or
[MarketConfiguration::protocol_account_id]). Read moreSource§impl Nep145 for Contract
impl Nep145 for Contract
Source§fn storage_deposit(
&mut self,
account_id: Option<AccountId>,
registration_only: Option<bool>,
) -> StorageBalance
fn storage_deposit( &mut self, account_id: Option<AccountId>, registration_only: Option<bool>, ) -> StorageBalance
Payable method that receives an attached deposit of NEAR for a given account. Read more
Source§fn storage_withdraw(&mut self, amount: Option<NearToken>) -> StorageBalance
fn storage_withdraw(&mut self, amount: Option<NearToken>) -> StorageBalance
Withdraw specified amount of available NEAR for predecessor account.
This method is safe to call, and does not remove data. Read more
Source§fn storage_unregister(&mut self, force: Option<bool>) -> bool
fn storage_unregister(&mut self, force: Option<bool>) -> bool
Unregister the predecessor account and withdraw all available NEAR. Read more
Source§fn storage_balance_of(&self, account_id: AccountId) -> Option<StorageBalance>
fn storage_balance_of(&self, account_id: AccountId) -> Option<StorageBalance>
Returns the storage balance for the given account, or
None if the account
is not registered.Source§fn storage_balance_bounds(&self) -> StorageBalanceBounds
fn storage_balance_bounds(&self) -> StorageBalanceBounds
Returns minimum and maximum allowed balance amounts to interact with this
contract. See [
StorageBalanceBounds] for more details.Source§impl Nep145ControllerInternal for Contract
impl Nep145ControllerInternal for Contract
Source§type ForceUnregisterHook = (Contract, ())
type ForceUnregisterHook = (Contract, ())
NEP-145 lifecycle hook.
§fn slot_balance_bounds() -> Slot<StorageBalanceBounds>
fn slot_balance_bounds() -> Slot<StorageBalanceBounds>
Storage slot for balance bounds.
§fn slot_account(account_id: &AccountIdRef) -> Slot<StorageBalance>
fn slot_account(account_id: &AccountIdRef) -> Slot<StorageBalance>
Storage slot for individual account balance.
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§
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> 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 more§impl<T> Nep145Controller for Twhere
T: Nep145ControllerInternal,
impl<T> Nep145Controller for Twhere
T: Nep145ControllerInternal,
§type ForceUnregisterHook = <T as Nep145ControllerInternal>::ForceUnregisterHook
type ForceUnregisterHook = <T as Nep145ControllerInternal>::ForceUnregisterHook
NEP-145 lifecycle hook.
§fn get_storage_balance(
&self,
account_id: &AccountIdRef,
) -> Result<StorageBalance, AccountNotRegisteredError>
fn get_storage_balance( &self, account_id: &AccountIdRef, ) -> Result<StorageBalance, AccountNotRegisteredError>
Returns the storage balance of the given account. Read more
§fn lock_storage(
&mut self,
account_id: &AccountIdRef,
amount: NearToken,
) -> Result<StorageBalance, StorageLockError>
fn lock_storage( &mut self, account_id: &AccountIdRef, amount: NearToken, ) -> Result<StorageBalance, StorageLockError>
Locks the given amount of storage balance for the given account. Read more
§fn unlock_storage(
&mut self,
account_id: &AccountIdRef,
amount: NearToken,
) -> Result<StorageBalance, StorageUnlockError>
fn unlock_storage( &mut self, account_id: &AccountIdRef, amount: NearToken, ) -> Result<StorageBalance, StorageUnlockError>
Unlocks the given amount of storage balance for the given account. Read more
§fn deposit_to_storage_account(
&mut self,
account_id: &AccountIdRef,
amount: NearToken,
) -> Result<StorageBalance, StorageDepositError>
fn deposit_to_storage_account( &mut self, account_id: &AccountIdRef, amount: NearToken, ) -> Result<StorageBalance, StorageDepositError>
Deposits the given amount of storage balance for the given account. Read more
§fn withdraw_from_storage_account(
&mut self,
account_id: &AccountIdRef,
amount: NearToken,
) -> Result<StorageBalance, StorageWithdrawError>
fn withdraw_from_storage_account( &mut self, account_id: &AccountIdRef, amount: NearToken, ) -> Result<StorageBalance, StorageWithdrawError>
Withdraws the given amount of storage balance for the given account. Read more
§fn unregister_storage_account(
&mut self,
account_id: &AccountIdRef,
) -> Result<NearToken, StorageUnregisterError>
fn unregister_storage_account( &mut self, account_id: &AccountIdRef, ) -> Result<NearToken, StorageUnregisterError>
Unregisters the given account, returning the amount of storage balance
that should be refunded. Read more
§fn force_unregister_storage_account(
&mut self,
account_id: &AccountIdRef,
) -> Result<NearToken, StorageForceUnregisterError>
fn force_unregister_storage_account( &mut self, account_id: &AccountIdRef, ) -> Result<NearToken, StorageForceUnregisterError>
Force unregisters the given account, returning the amount of storage balance
that should be refunded. Read more
§fn get_storage_balance_bounds(&self) -> StorageBalanceBounds
fn get_storage_balance_bounds(&self) -> StorageBalanceBounds
Returns the storage balance bounds for the contract.
§fn set_storage_balance_bounds(&mut self, bounds: &StorageBalanceBounds)
fn set_storage_balance_bounds(&mut self, bounds: &StorageBalanceBounds)
Sets the storage balance bounds for the contract.
§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> ServiceExt for T
impl<T> ServiceExt for T
§fn propagate_header(self, header: HeaderName) -> PropagateHeader<Self>where
Self: Sized,
fn propagate_header(self, header: HeaderName) -> PropagateHeader<Self>where
Self: Sized,
Propagate a header from the request to the response. Read more
§fn add_extension<T>(self, value: T) -> AddExtension<Self, T>where
Self: Sized,
fn add_extension<T>(self, value: T) -> AddExtension<Self, T>where
Self: Sized,
Add some shareable value to request extensions. Read more
§fn map_request_body<F>(self, f: F) -> MapRequestBody<Self, F>where
Self: Sized,
fn map_request_body<F>(self, f: F) -> MapRequestBody<Self, F>where
Self: Sized,
Apply a transformation to the request body. Read more
§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Apply a transformation to the response body. Read more
§fn compression(self) -> Compression<Self>where
Self: Sized,
fn compression(self) -> Compression<Self>where
Self: Sized,
Compresses response bodies. Read more
§fn decompression(self) -> Decompression<Self>where
Self: Sized,
fn decompression(self) -> Decompression<Self>where
Self: Sized,
Decompress response bodies. Read more
§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more
§fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
§fn sensitive_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>where
Self: Sized,
fn sensitive_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>where
Self: Sized,
§fn sensitive_request_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<Self>where
Self: Sized,
fn sensitive_request_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<Self>where
Self: Sized,
§fn sensitive_response_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveResponseHeaders<Self>where
Self: Sized,
fn sensitive_response_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveResponseHeaders<Self>where
Self: Sized,
§fn override_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn override_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
Insert a header into the request. Read more
§fn append_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn append_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
Append a header into the request. Read more
§fn insert_request_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn insert_request_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
Insert a header into the request, if the header is not already present. Read more
§fn override_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn override_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
Insert a header into the response. Read more
§fn append_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn append_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
Append a header into the response. Read more
§fn insert_response_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn insert_response_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
Insert a header into the response, if the header is not already present. Read more
§fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
Add request id header and extension. Read more
§fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
Add request id header and extension, using
x-request-id as the header name. Read more§fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
Propgate request ids from requests to responses. Read more
§fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
Propgate request ids from requests to responses, using
x-request-id as the header name. Read more§fn catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>where
Self: Sized,
fn catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>where
Self: Sized,
Catch panics and convert them into
500 Internal Server responses. Read more§fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>where
Self: Sized,
fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>where
Self: Sized,
Intercept requests with over-sized payloads and convert them into
413 Payload Too Large responses. Read more§fn trim_trailing_slash(self) -> NormalizePath<Self>where
Self: Sized,
fn trim_trailing_slash(self) -> NormalizePath<Self>where
Self: Sized,
Remove trailing slashes from paths. Read more
§fn append_trailing_slash(self) -> NormalizePath<Self>where
Self: Sized,
fn append_trailing_slash(self) -> NormalizePath<Self>where
Self: Sized,
Append trailing slash to paths. Read more
§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.