pub unsafe trait Storage: AsRef<[MaybeUninit<Self::Item>]> + AsMut<[MaybeUninit<Self::Item>]> {
type Item;
// Required methods
fn reserve(&mut self, new_capacity: usize);
fn try_reserve(&mut self, new_capacity: usize) -> AllocResult;
}
Expand description
A type that can hold Self::Item
s, and potentially reserve space for more.
§Safety
Other safe types rely on this trait being implemented correctly. See the safety requirements on each function
Required Associated Types§
Required Methods§
Sourcefn try_reserve(&mut self, new_capacity: usize) -> AllocResult
fn try_reserve(&mut self, new_capacity: usize) -> AllocResult
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.