pub struct AssetChainVariantOwnedView(/* private fields */);Expand description
Self-contained, 'static owned view of a AssetChainVariant message.
Wraps ::buffa::OwnedView<AssetChainVariantView<'static>>: the decoded view and the ::buffa::bytes::Bytes buffer it borrows from travel together, so the handle is 'static and Send + Sync — suitable for async handlers, spawned tasks, and anywhere a 'static bound is required.
Field accessors return borrows tied to &self. Use Self::view to get the full AssetChainVariantView when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.
Implementations§
Source§impl AssetChainVariantOwnedView
impl AssetChainVariantOwnedView
Sourcepub fn decode(bytes: Bytes) -> Result<Self, DecodeError>
pub fn decode(bytes: Bytes) -> Result<Self, DecodeError>
Decode an owned view from a ::buffa::bytes::Bytes buffer.
The view borrows directly from the buffer’s data; the buffer is retained inside the returned handle.
§Errors
Returns ::buffa::DecodeError if the buffer contains invalid
protobuf data.
Sourcepub fn decode_with_options(
bytes: Bytes,
opts: &DecodeOptions,
) -> Result<Self, DecodeError>
pub fn decode_with_options( bytes: Bytes, opts: &DecodeOptions, ) -> Result<Self, DecodeError>
Decode with custom ::buffa::DecodeOptions (recursion limit,
max message size).
§Errors
Returns ::buffa::DecodeError if the buffer is invalid or
exceeds the configured limits.
Sourcepub fn from_owned(msg: &AssetChainVariant) -> Result<Self, DecodeError>
pub fn from_owned(msg: &AssetChainVariant) -> Result<Self, DecodeError>
Build from an owned message via an encode → decode round-trip.
§Errors
Returns ::buffa::DecodeError if the re-encoded bytes are
somehow invalid (should not happen for well-formed messages).
Sourcepub fn view(&self) -> &AssetChainVariantView<'_>
pub fn view(&self) -> &AssetChainVariantView<'_>
Borrow the full AssetChainVariantView with its lifetime tied to &self.
Sourcepub fn to_owned_message(&self) -> Result<AssetChainVariant, DecodeError>
pub fn to_owned_message(&self) -> Result<AssetChainVariant, DecodeError>
Convert to the owned message type.
§Errors
Returns an error if re-materializing preserved unknown fields fails (e.g. the unknown-field limit is exceeded).
Sourcepub fn into_bytes(self) -> Bytes
pub fn into_bytes(self) -> Bytes
Consume the handle, returning the underlying bytes buffer.
Sourcepub fn zipped_asset_id(&self) -> u32
pub fn zipped_asset_id(&self) -> u32
Canonical zipped asset route id.
Field 1: zipped_asset_id
Sourcepub fn is_native_asset(&self) -> bool
pub fn is_native_asset(&self) -> bool
True when the asset is the native gas/token of the source chain.
Field 3: is_native_asset
Sourcepub fn network_fee(&self) -> &str
pub fn network_fee(&self) -> &str
Latest known network fee for this chain asset variant as a human-readable string in zToken units, with insignificant trailing zeroes trimmed.
Field 4: network_fee
Sourcepub fn ztoken_address(&self) -> &str
pub fn ztoken_address(&self) -> &str
Polyester zToken contract address for this chain asset variant.
Field 6: ztoken_address
Sourcepub fn source_address(&self) -> &str
pub fn source_address(&self) -> &str
Source-chain token contract, mint, or native sentinel address.
Field 7: source_address
Sourcepub fn source_decimals(&self) -> u32
pub fn source_decimals(&self) -> u32
Source-chain token decimals.
Field 8: source_decimals
Sourcepub fn ztoken_decimals(&self) -> u32
pub fn ztoken_decimals(&self) -> u32
zToken decimals on Polyester chain.
Field 9: ztoken_decimals
Sourcepub fn deposit_min_amount(&self) -> &str
pub fn deposit_min_amount(&self) -> &str
Minimum deposit amount for this variant as a human-readable string in zToken units.
Field 10: deposit_min_amount
Sourcepub fn withdraw_min_amount(&self) -> &str
pub fn withdraw_min_amount(&self) -> &str
Minimum withdraw amount for this variant as a human-readable string in zToken units.
Field 11: withdraw_min_amount
Trait Implementations§
Source§impl AsRef<OwnedView<AssetChainVariantView<'static>>> for AssetChainVariantOwnedView
impl AsRef<OwnedView<AssetChainVariantView<'static>>> for AssetChainVariantOwnedView
Source§fn as_ref(&self) -> &OwnedView<AssetChainVariantView<'static>>
fn as_ref(&self) -> &OwnedView<AssetChainVariantView<'static>>
Source§impl Clone for AssetChainVariantOwnedView
impl Clone for AssetChainVariantOwnedView
Source§fn clone(&self) -> AssetChainVariantOwnedView
fn clone(&self) -> AssetChainVariantOwnedView
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more