rust - Which library to use for Weak references -


i realize things still in flux, why weak referenced in 2 different places in documentation?

std::rc::weak - http://doc.rust-lang.org/stable/std/rc/struct.weak.html

alloc::rc::weak - http://doc.rust-lang.org/stable/alloc/rc/struct.weak.html

maybe i'm missing something, difference see in 2 fmt function signatures:

impl<t> debug weak<t> t: debug fn fmt(&self, f: &mut formatter) -> result<(), error> 

vs

impl<t: debug> debug weak<t> fn fmt(&self, f: &mut formatter) -> result 

so 1 should use? they're both marked "unstable".

rust's standard library made of multiple, interconnected crates. std, aside containing of own functionality, acts "facade" on these other crates, publicly re-exporting bits have been stabilised.

there is, in fact, 1 weak: 1 in alloc. it's std re-exports it. 1 use: if available through std, use through std: that's path that's unlikely change...

...except when comes unstable features, of weak one: it's unstable, there no guarantees.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -