Struct abstract_os::objects::proxy_asset::ProxyAsset
source · [−]pub struct ProxyAsset {
pub asset: AssetEntry,
pub value_reference: Option<ValueRef>,
}Expand description
Every ProxyAsset provides a way to determine its value recursively relative to a base asset.
Fields
asset: AssetEntryAsset entry that maps to an AssetInfo using raw-queries on memory
value_reference: Option<ValueRef>The value reference provides the tooling to get the value of the asset relative to the base asset.
Implementations
sourceimpl ProxyAsset
impl ProxyAsset
sourcepub fn value(
&mut self,
deps: Deps<'_>,
env: &Env,
memory: &Memory,
set_holding: Option<Uint128>
) -> StdResult<Uint128>
pub fn value(
&mut self,
deps: Deps<'_>,
env: &Env,
memory: &Memory,
set_holding: Option<Uint128>
) -> StdResult<Uint128>
Calculates the value of the asset through the optionally provided ValueReference
sourcepub fn trade_pair_value(
&self,
deps: Deps<'_>,
env: &Env,
memory: &Memory,
valued_asset: Asset,
pair: ContractEntry
) -> StdResult<Uint128>
pub fn trade_pair_value(
&self,
deps: Deps<'_>,
env: &Env,
memory: &Memory,
valued_asset: Asset,
pair: ContractEntry
) -> StdResult<Uint128>
Calculates the value of an asset compared to some base asset through the provided trading pair.
Trait Implementations
sourceimpl Clone for ProxyAsset
impl Clone for ProxyAsset
sourcefn clone(&self) -> ProxyAsset
fn clone(&self) -> ProxyAsset
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl Debug for ProxyAsset
impl Debug for ProxyAsset
sourceimpl<'de> Deserialize<'de> for ProxyAsset
impl<'de> Deserialize<'de> for ProxyAsset
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl JsonSchema for ProxyAsset
impl JsonSchema for ProxyAsset
sourcefn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
sourcefn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
sourcefn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moresourceimpl PartialEq<ProxyAsset> for ProxyAsset
impl PartialEq<ProxyAsset> for ProxyAsset
sourcefn eq(&self, other: &ProxyAsset) -> bool
fn eq(&self, other: &ProxyAsset) -> bool
sourceimpl Serialize for ProxyAsset
impl Serialize for ProxyAsset
impl Eq for ProxyAsset
impl StructuralEq for ProxyAsset
impl StructuralPartialEq for ProxyAsset
Auto Trait Implementations
impl RefUnwindSafe for ProxyAsset
impl Send for ProxyAsset
impl Sync for ProxyAsset
impl Unpin for ProxyAsset
impl UnwindSafe for ProxyAsset
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more