• Home
  • Raw
  • Download

Lines Matching full:weak

1 //! Traits for describing strong and weak pointers and their use as elements and keys.
3 //! These traits provide mechanisms for converting between weak and strong pointers
6 //! `std::rc::Weak` and `std::sync::Weak`. If you would like to use your own pointer type
7 //! as a weak element, you need to implement `WeakElement` for your weak pointer type; to use it
8 //! as a weak key, implement `WeakKey` as well.
12 /// Interface for elements that can be stored in weak hash tables.
14 /// This trait applies to the weak version of a reference-counted pointer; it can be used to
15 /// convert a weak pointer into a strong pointer and back. For example, the impl for
16 /// `std::rc::Weak<T>` defines the `Strong` associated type as `std::rc::Rc<T>`. Then method
17 /// `new` can be used to downgrade an `Rc<T>` to a `Weak<T>`, and method `view` can be used to
18 /// upgrade a `Weak<T>` into an `Rc<T>`, if it's still alive. If we think of the weak pointer as
21 /// The type at which a weak element can be viewed.
23 /// For example, for `std::rc::Weak<T>`, this will be `std::rc::Rc<T>`.
26 /// Constructs a weak pointer from a strong pointer.
31 /// Acquires a strong pointer from a weak pointer.
36 /// Is the given weak element expired?
53 /// Interface for elements that can act as keys in weak hash tables.
55 /// To use an element as a weak hash map key or weak hash set element), the hash table
61 /// For example, for `std::rc::Weak<T>`, this will be `T`.
87 impl<T: ?Sized> WeakElement for rc::Weak<T> { implementation
103 impl<T: ?Sized + Eq + Hash> WeakKey for rc::Weak<T> { implementation
113 impl<T: ?Sized> WeakElement for sync::Weak<T> { implementation
129 impl<T: ?Sized + Eq + Hash> WeakKey for sync::Weak<T> implementation