pub struct Address { /* private fields */ }Expand description
Address is the struct that defines the protocol and data payload conversion from either a public key or value
Implementations§
Source§impl Address
impl Address
Sourcepub fn from_bytes(bz: &[u8]) -> Result<Self, Error>
pub fn from_bytes(bz: &[u8]) -> Result<Self, Error>
Creates address from encoded bytes
Sourcepub fn new_secp256k1(pubkey: &[u8]) -> Result<Self, Error>
pub fn new_secp256k1(pubkey: &[u8]) -> Result<Self, Error>
Generates new address using Secp256k1 pubkey
Sourcepub fn payload(&self) -> &Payload
pub fn payload(&self) -> &Payload
Returns the Payload object from the address, where the respective protocol data is kept
in an enum separated by protocol
Sourcepub fn into_payload(self) -> Payload
pub fn into_payload(self) -> Payload
Converts Address into Payload object, where the respective protocol data is kept
in an enum separated by protocol
Sourcepub fn payload_bytes(&self) -> Vec<u8> ⓘ
pub fn payload_bytes(&self) -> Vec<u8> ⓘ
Returns the raw bytes data payload of the Address
Sourcepub fn set_network(&mut self, network: Network) -> &mut Self
pub fn set_network(&mut self, network: Network) -> &mut Self
Sets the network for the address and returns a mutable reference to it
Trait Implementations§
Source§impl Cbor for Address
impl Cbor for Address
Source§impl<'de> Deserialize<'de> for Address
impl<'de> Deserialize<'de> for Address
Source§fn 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
impl 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§
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