Skip to content

Commit 97b90ef

Browse files
committed
Add documentation to OpaqueDebug
1 parent 2a2b8c4 commit 97b90ef

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/vm/src/parsed_wasm.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ use wasmer::wasmparser::{
88

99
use crate::{VmError, VmResult};
1010

11+
/// Opaque wrapper type implementing `Debug`
12+
///
13+
/// The purpose of this type is to wrap types that do not implement `Debug` themselves.
14+
/// For example, you have a large struct and derive `Debug` on it but one member does not implement the trait, that's where this type comes in.
15+
///
16+
/// Instead of printing a full debug representation of the underlying data, it simply prints something akin to this:
17+
///
18+
/// ```
19+
/// WrappedType { ... }
20+
/// ```
1121
#[derive(Default)]
1222
pub struct OpaqueDebug<T>(pub T);
1323

0 commit comments

Comments
 (0)