Debug ProcBinInner flags as binary
use core::alloc::{AllocErr, Layout};
use core::cmp;
use core::convert::TryInto;
+use core::fmt::{self, Debug};
use core::mem;
use core::ptr::{self, NonNull};
use core::slice;
@@ -68,6 +69,16 @@ impl ProcBinInner {
}
}
+impl Debug for ProcBinInner {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ f.debug_struct("ProcBinInner")
+ .field("refc", &self.refc)
+ .field("flags", &format_args!("{:#b}", self.flags))
+ .field("bytes", &self.bytes)
+ .finish()
+ }
+}
+
/// Reference-counted heap-allocated binary
///
/// This struct doesn't actually have the data, but it is the entry point
