MCPcopy Create free account
hub / github.com/SeaQL/FireDBG.for.Rust / main

Function main

debugger/testcases/dyn_box.rs:31–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29}
30
31fn main() {
32 let boxed: Box<dyn MyTrait> = Box::new(MyStruct { i: 1234 });
33 println!("Box {{ i: {} }}", boxed.i());
34 open(&boxed);
35 let rc: Rc<dyn MyTrait> = Rc::new(MyStruct { i: 1234 });
36 println!("Rc {{ i: {} }}", rc.i());
37 open(&rc);
38 let arc: Arc<dyn MyTrait> = Arc::new(MyOther { not_i: 5678 });
39 println!("Arc {{ i: {} }}", arc.i());
40 open(&arc);
41}

Callers

nothing calls this directly

Calls 1

openFunction · 0.85

Tested by

no test coverage detected