Trait weak_table::traits::WeakElement
[−]
[src]
pub trait WeakElement {
type Strong;
fn new(view: &Self::Strong) -> Self;
fn view(&self) -> Option<Self::Strong>;
fn expired(&self) -> bool { ... }
fn clone(view: &Self::Strong) -> Self::Strong
where
Self: Sized,
{ ... }
}Interface for elements that can be stored in a weak hash table.
Associated Types
type Strong
The type at which a weak element can be viewed.
For example, for std::rc::Weak<T>, this will be std::rc::Rc<T>.
Required Methods
fn new(view: &Self::Strong) -> Self
Constructs a new weak element from a strong view.
fn view(&self) -> Option<Self::Strong>
Acquires a strong version of the weak element.
Provided Methods
fn expired(&self) -> bool
Is the given weak element expired?
fn clone(view: &Self::Strong) -> Self::Strong where
Self: Sized,
Self: Sized,
Clones a strong view.