Merge pull request #46 from rust-bitcoin/2018-08-context-debug
add Debug impl to context object
This commit is contained in:
commit
3563c5f305
24
src/lib.rs
24
src/lib.rs
|
@ -546,6 +546,30 @@ impl<C> Drop for Secp256k1<C> {
|
|||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for Secp256k1<None> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "<secp256k1 context {:?}, no capabilities>", self.ctx)
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for Secp256k1<SignOnly> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "<secp256k1 context {:?}, signing only>", self.ctx)
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for Secp256k1<VerifyOnly> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "<secp256k1 context {:?}, verification only>", self.ctx)
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for Secp256k1<All> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "<secp256k1 context {:?}, all capabilities>", self.ctx)
|
||||
}
|
||||
}
|
||||
|
||||
impl Secp256k1<None> {
|
||||
/// Creates a new Secp256k1 context with no capabilities (just de/serialization)
|
||||
pub fn without_caps() -> Secp256k1<None> {
|
||||
|
|
Loading…
Reference in New Issue