pub trait ScriptHashExtensionwhere
Self: Sized,{
// Required methods
fn to_bs58_string(&self) -> String;
fn zero() -> Self;
fn from_slice(slice: &[u8]) -> Result<Self, TypeError>;
fn from_hex(hex: &str) -> Result<Self, FromHexError>;
fn from_address(address: &str) -> Result<Self, TypeError>;
fn to_address(&self) -> String;
fn to_hex(&self) -> String;
fn to_hex_big_endian(&self) -> String;
fn to_vec(&self) -> Vec<u8> ⓘ;
fn to_le_vec(&self) -> Vec<u8> ⓘ;
fn from_script(script: &[u8]) -> Self;
fn from_public_key(public_key: &[u8]) -> Result<Self, TypeError>;
}
Expand description
Trait that provides additional methods for types related to ScriptHash
.
Required Methods§
Sourcefn to_bs58_string(&self) -> String
fn to_bs58_string(&self) -> String
Returns a string representation of the object.
Sourcefn from_slice(slice: &[u8]) -> Result<Self, TypeError>
fn from_slice(slice: &[u8]) -> Result<Self, TypeError>
Sourcefn from_hex(hex: &str) -> Result<Self, FromHexError>
fn from_hex(hex: &str) -> Result<Self, FromHexError>
Sourcefn from_address(address: &str) -> Result<Self, TypeError>
fn from_address(address: &str) -> Result<Self, TypeError>
Creates an instance from an address string representation.
§Errors
Returns an error if the address is invalid.
Sourcefn to_address(&self) -> String
fn to_address(&self) -> String
Converts the object into its address string representation.
Sourcefn to_hex_big_endian(&self) -> String
fn to_hex_big_endian(&self) -> String
Converts the object into its hex string representation.
Sourcefn from_script(script: &[u8]) -> Self
fn from_script(script: &[u8]) -> Self
Creates an instance from a script byte slice.
fn from_public_key(public_key: &[u8]) -> Result<Self, TypeError>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.