Loading RustViz Engine...
Implement Deref coercion so custom wrapper transparently accesses inner methods.
This problem is currently in blueprint template mode. Once the concept foundation is finalized, live in-browser WebAssembly compilation and test assertion runners will be enabled here.
use std::ops::Deref;
pub struct MyBox<T>(T);
impl<T> MyBox<T> {
pub fn new(x: T) -> Self { MyBox(x) }
}
impl<T> Deref for MyBox<T> {
type Target = T;
fn deref(&self) -> &Self::Target { &self.0 }
}