Struct oasis_runtime_sdk::types::address::Address
source · pub struct Address(/* private fields */);
Expand description
An account address.
Implementations§
source§impl Address
impl Address
sourcepub fn new(ctx: &'static [u8], version: u8, data: &[u8]) -> Self
pub fn new(ctx: &'static [u8], version: u8, data: &[u8]) -> Self
Creates a new address from a context, version and data.
sourcepub fn from_bytes(data: &[u8]) -> Result<Self, Error>
pub fn from_bytes(data: &[u8]) -> Result<Self, Error>
Tries to create a new address from raw bytes.
sourcepub fn into_bytes(self) -> [u8; 21]
pub fn into_bytes(self) -> [u8; 21]
Convert the address into raw bytes.
sourcepub fn from_module(module: &str, kind: &str) -> Self
pub fn from_module(module: &str, kind: &str) -> Self
Creates a new address for a specific module and kind.
sourcepub fn from_module_raw(module: &str, kind: &[u8]) -> Self
pub fn from_module_raw(module: &str, kind: &[u8]) -> Self
Creates a new address for a specific module and raw kind.
sourcepub fn from_runtime_id(id: &Namespace) -> Self
pub fn from_runtime_id(id: &Namespace) -> Self
Creates a new runtime address.
sourcepub fn from_sigspec(spec: &SignatureAddressSpec) -> Self
pub fn from_sigspec(spec: &SignatureAddressSpec) -> Self
Creates a new address from a public key.
sourcepub fn from_multisig(config: Config) -> Self
pub fn from_multisig(config: Config) -> Self
Creates a new address from a multisig configuration.
sourcepub fn from_eth(eth_address: &[u8]) -> Self
pub fn from_eth(eth_address: &[u8]) -> Self
Creates a new address from an Ethereum-compatible address.
sourcepub fn from_consensus_pk(pk: &ConsensusPublicKey) -> Self
pub fn from_consensus_pk(pk: &ConsensusPublicKey) -> Self
Creates a new address from a consensus-layer Ed25519 public key.
This is a convenience wrapper and the same result can be obtained by going via the
from_sigspec
method using the same Ed25519 public key.
sourcepub fn from_bech32(data: &str) -> Result<Self, Error>
pub fn from_bech32(data: &str) -> Result<Self, Error>
Tries to create a new address from Bech32-encoded string.
Trait Implementations§
source§impl Decode for Address
impl Decode for Address
source§fn try_default() -> Result<Self, DecodeError>
fn try_default() -> Result<Self, DecodeError>
Try to decode from a missing/null/undefined value.
source§fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>
fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>
Try to decode from a given CBOR value.
§fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>where
Self: Sized,
fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>where
Self: Sized,
Try to decode from a given CBOR value, calling
try_default
in case the value is null or
undefined.source§impl From<Address> for Address
impl From<Address> for Address
source§fn from(addr: Address) -> ConsensusAddress
fn from(addr: Address) -> ConsensusAddress
Converts to this type from the input type.
source§impl Ord for Address
impl Ord for Address
source§impl PartialEq for Address
impl PartialEq for Address
source§impl PartialOrd for Address
impl PartialOrd for Address
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Address
impl Eq for Address
impl StructuralPartialEq for Address
Auto Trait Implementations§
impl Freeze for Address
impl RefUnwindSafe for Address
impl Send for Address
impl Sync for Address
impl Unpin for Address
impl UnwindSafe for Address
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> ToHex for T
impl<T> ToHex for T
source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Lower case
letters are used (e.g. f9b4ca
)source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
)