Trait implemented by types which can be placed in a stack. It should not be implemented for any type outside of this crate.
| 22 | /// |
| 23 | /// It should not be implemented for any type outside of this crate. |
| 24 | pub trait Stackable: ForeignType { |
| 25 | /// The C stack type for this element. |
| 26 | /// |
| 27 | /// Generally called `stack_st_{ELEMENT_TYPE}`, normally hidden by the |
| 28 | /// `STACK_OF(ELEMENT_TYPE)` macro in the OpenSSL API. |
| 29 | type StackType; |
| 30 | } |
| 31 | |
| 32 | /// An owned stack of `T`. |
| 33 | pub struct Stack<T: Stackable>(*mut T::StackType); |