pub struct BitcoinEncoder<P: NetworkParams>(_);
Expand description
The standard encoder for Bitcoin networks. Parameterized by a NetworkParams
type and an
coins_bip32::Encoder
. It exposes
Trait Implementations
sourceimpl<P: NetworkParams> AddressEncoder for BitcoinEncoder<P>
impl<P: NetworkParams> AddressEncoder for BitcoinEncoder<P>
type Address = Address
type Address = Address
A type representing the user-facing address, with any disambiguating information.
type Error = EncodingError
type Error = EncodingError
An error type that will be returned in case of encoding errors
type RecipientIdentifier = ScriptPubkey
type RecipientIdentifier = ScriptPubkey
A type representing the in-protocol recipient. This is usually different from the
Address type. The encoder converts between Strings
, Address
es, and
RecipientIdentifier
s Read more
sourcefn encode_address(s: &ScriptPubkey) -> EncodingResult<Address>
fn encode_address(s: &ScriptPubkey) -> EncodingResult<Address>
Attempt to encode a RecipientIdentifier
as an Address
.
sourcefn decode_address(addr: &Address) -> ScriptPubkey
fn decode_address(addr: &Address) -> ScriptPubkey
Decode a RecipientIdentifier
from an Address
. Addresses should be defined such that
this cannot fail. Read more
sourcefn string_to_address(string: &str) -> EncodingResult<Address>
fn string_to_address(string: &str) -> EncodingResult<Address>
Attempt to convert a string into an Address
.
sourceimpl<P: Clone + NetworkParams> Clone for BitcoinEncoder<P>
impl<P: Clone + NetworkParams> Clone for BitcoinEncoder<P>
sourcefn clone(&self) -> BitcoinEncoder<P>
fn clone(&self) -> BitcoinEncoder<P>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<P: Debug + NetworkParams> Debug for BitcoinEncoder<P>
impl<P: Debug + NetworkParams> Debug for BitcoinEncoder<P>
sourceimpl<P: PartialEq + NetworkParams> PartialEq<BitcoinEncoder<P>> for BitcoinEncoder<P>
impl<P: PartialEq + NetworkParams> PartialEq<BitcoinEncoder<P>> for BitcoinEncoder<P>
sourcefn eq(&self, other: &BitcoinEncoder<P>) -> bool
fn eq(&self, other: &BitcoinEncoder<P>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &BitcoinEncoder<P>) -> bool
fn ne(&self, other: &BitcoinEncoder<P>) -> bool
This method tests for !=
.
impl<P: NetworkParams> BitcoinEncoderMarker for BitcoinEncoder<P>
impl<P: Eq + NetworkParams> Eq for BitcoinEncoder<P>
impl<P: NetworkParams> StructuralEq for BitcoinEncoder<P>
impl<P: NetworkParams> StructuralPartialEq for BitcoinEncoder<P>
Auto Trait Implementations
impl<P> RefUnwindSafe for BitcoinEncoder<P>
impl<P> Send for BitcoinEncoder<P>
impl<P> Sync for BitcoinEncoder<P>
impl<P> Unpin for BitcoinEncoder<P>
impl<P> UnwindSafe for BitcoinEncoder<P>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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