pub struct WIF(/* private fields */);
Expand description
Contains validated WIF bytes. It assumess compression is always used.
Implementations§
Source§impl WIF
impl WIF
Sourcepub fn new(network: Network, private_key: PrivateKey) -> Self
pub fn new(network: Network, private_key: PrivateKey) -> Self
Constructs a WIF from a network and private key
Sourcepub fn from_bytes(bytes: impl AsRef<[u8]>) -> StacksResult<Self>
pub fn from_bytes(bytes: impl AsRef<[u8]>) -> StacksResult<Self>
Attempts to parse a WIF from a byte slice
Sourcepub fn network(&self) -> StacksResult<Network>
pub fn network(&self) -> StacksResult<Network>
Returns the network
Sourcepub fn private_key(&self) -> StacksResult<PrivateKey>
pub fn private_key(&self) -> StacksResult<PrivateKey>
Returns the private key
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WIF
impl RefUnwindSafe for WIF
impl Send for WIF
impl Sync for WIF
impl Unpin for WIF
impl UnwindSafe for WIF
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