Trait redox::ops::Drop
[−]
[src]
pub trait Drop { fn drop(&mut self); }
The Drop
trait is used to run some code when a value goes out of scope.
This is sometimes called a 'destructor'.
Examples
A trivial implementation of Drop
. The drop
method is called when _x
goes out of scope, and therefore main
prints Dropping!
.
struct HasDrop; impl Drop for HasDrop { fn drop(&mut self) { println!("Dropping!"); } } fn main() { let _x = HasDrop; }
Required Methods
Implementors
impl<'b> Drop for BorrowRef<'b>
impl<'b> Drop for BorrowRefMut<'b>
impl<T> Drop for IntermediateBox<T> where T: ?Sized
impl<T> Drop for Arc<T> where T: ?Sized
impl<T> Drop for Weak<T> where T: ?Sized
impl<T> Drop for Rc<T> where T: ?Sized
impl<T> Drop for Weak<T> where T: ?Sized
impl<T> Drop for RawVec<T>
impl<'a, T> Drop for Hole<'a, T>
impl<T> Drop for RawItems<T>
impl<K, V> Drop for Node<K, V>
impl<K, V> Drop for MoveTraversalImpl<K, V>
impl<T> Drop for LinkedList<T>
impl<'a> Drop for Drain<'a>
impl<T> Drop for Vec<T>
impl<T> Drop for IntoIter<T>
impl<'a, T> Drop for Drain<'a, T>
impl<T> Drop for VecDeque<T>
impl<'a, T> Drop for Drain<'a, T> where T: 'a
impl Drop for File
impl<T: ?Sized> Drop for IntermediateBox<T>
impl<T: ?Sized> Drop for Arc<T>
impl<T: ?Sized> Drop for Weak<T>
impl<T: ?Sized> Drop for Rc<T>
impl<T: ?Sized> Drop for Weak<T>
impl<T> Drop for RawVec<T>
impl Drop for ContextMemory
impl Drop for Context
impl Drop for Elf
impl Drop for StaticIntexGuard
impl<T> Drop for Memory<T>
impl Drop for Pager
impl Drop for PageDirectory
impl Drop for PageTable
impl Drop for Prdt
impl Drop for SchemeInner
impl Drop for SchemeResource
impl Drop for Display
impl Drop for FileResource