Lines Matching full:stack
31 /// Trait implemented by types which can be placed in a stack.
35 /// The C stack type for this element.
42 /// An owned stack of `T`.
43 pub struct Stack<T: Stackable>(*mut T::StackType); struct
45 unsafe impl<T: Stackable + Send> Send for Stack<T> {} implementation
46 unsafe impl<T: Stackable + Sync> Sync for Stack<T> {} implementation
48 impl<T> fmt::Debug for Stack<T> implementation
57 impl<T: Stackable> Drop for Stack<T> { implementation
66 impl<T: Stackable> Stack<T> { implementation
67 pub fn new() -> Result<Stack<T>, ErrorStack> { in new()
71 Ok(Stack(ptr as *mut _)) in new()
76 impl<T: Stackable> iter::IntoIterator for Stack<T> { implementation
82 stack: self.0, in into_iter()
90 impl<T: Stackable> AsRef<StackRef<T>> for Stack<T> { implementation
96 impl<T: Stackable> Borrow<StackRef<T>> for Stack<T> { implementation
102 impl<T: Stackable> ForeignType for Stack<T> { implementation
107 unsafe fn from_ptr(ptr: *mut T::StackType) -> Stack<T> { in from_ptr()
110 "Must not instantiate a Stack from a null-ptr - use Stack::new() in \ in from_ptr()
113 Stack(ptr) in from_ptr()
122 impl<T: Stackable> Deref for Stack<T> { implementation
130 impl<T: Stackable> DerefMut for Stack<T> { implementation
137 stack: *mut T::StackType, field
147 OPENSSL_sk_free(self.stack as *mut _); in drop()
159 .map(|i| T::from_ptr(OPENSSL_sk_value(self.stack as *mut _, i) as *mut _)) in next()
173 .map(|i| T::from_ptr(OPENSSL_sk_value(self.stack as *mut _, i) as *mut _)) in next_back()
194 /// Returns the number of items in the stack.
199 /// Determines if the stack is empty.
206 stack: self, in iter()
214 stack: self, in iter_mut()
219 /// stack or `None` if the index is out of bounds
231 /// stack or `None` if the index is out of bounds
242 /// Pushes a value onto the top of the stack.
251 /// Removes the last element from the stack and returns it.
296 impl<'a, T: Stackable> iter::IntoIterator for &'a Stack<T> { implementation
305 impl<'a, T: Stackable> iter::IntoIterator for &'a mut Stack<T> { implementation
314 /// An iterator over the stack's contents.
316 stack: &'a StackRef<T>, field
327 .map(|i| T::Ref::from_ptr(OPENSSL_sk_value(self.stack.as_stack(), i) as *mut _)) in next()
341 .map(|i| T::Ref::from_ptr(OPENSSL_sk_value(self.stack.as_stack(), i) as *mut _)) in next_back()
348 /// A mutable iterator over the stack's contents.
350 stack: &'a mut StackRef<T>, field
361 .map(|i| T::Ref::from_ptr_mut(OPENSSL_sk_value(self.stack.as_stack(), i) as *mut _)) in next()
375 .map(|i| T::Ref::from_ptr_mut(OPENSSL_sk_value(self.stack.as_stack(), i) as *mut _)) in next_back()