[−][src]Trait bumpalo::BumpAllocSafe
A marker trait for types that are "safe" to bump alloc.
Objects that are bump-allocated will not have their Drop
implementation
called, which makes it easy to leak memory or other resources. If you put
anything which heap allocates or manages open file descriptors or other
resources into a Bump
, and that thing relies on its Drop
implementation
to clean up after itself, then you need to find a new way to clean up after
it yourself. This could be calling
drop_in_place
,
or simply avoiding using such types in a Bump
.
This is memory safe! Since destructors are never guaranteed to run in Rust,
you can't rely on them for enforcing memory safety. Therefore, implementing
this trait is not unsafe
in the Rust sense (which is only about memory
safety). But instead of taking any T
, bump allocation requires that you
implement this marker trait for T
just so that you know what you're
getting into.
Example
struct Point { x: u64, y: u64, } // We want to bump allocate `Point`s, so we implement // `BumpAllocSafe` for them. impl bumpalo::BumpAllocSafe for Point {}
Implementations on Foreign Types
impl<'a, T: ?Sized> BumpAllocSafe for &'a T
[src]
impl<'a, T: ?Sized> BumpAllocSafe for &'a T
impl<'a, T: ?Sized> BumpAllocSafe for &'a mut T
[src]
impl<'a, T: ?Sized> BumpAllocSafe for &'a mut T
impl BumpAllocSafe for i8
[src]
impl BumpAllocSafe for i8
impl BumpAllocSafe for i16
[src]
impl BumpAllocSafe for i16
impl BumpAllocSafe for i32
[src]
impl BumpAllocSafe for i32
impl BumpAllocSafe for i64
[src]
impl BumpAllocSafe for i64
impl BumpAllocSafe for i128
[src]
impl BumpAllocSafe for i128
impl BumpAllocSafe for isize
[src]
impl BumpAllocSafe for isize
impl BumpAllocSafe for u8
[src]
impl BumpAllocSafe for u8
impl BumpAllocSafe for u16
[src]
impl BumpAllocSafe for u16
impl BumpAllocSafe for u32
[src]
impl BumpAllocSafe for u32
impl BumpAllocSafe for u64
[src]
impl BumpAllocSafe for u64
impl BumpAllocSafe for u128
[src]
impl BumpAllocSafe for u128
impl BumpAllocSafe for usize
[src]
impl BumpAllocSafe for usize
impl BumpAllocSafe for bool
[src]
impl BumpAllocSafe for bool
impl<T> BumpAllocSafe for *const T
[src]
impl<T> BumpAllocSafe for *const T
impl<T> BumpAllocSafe for *mut T
[src]
impl<T> BumpAllocSafe for *mut T
impl<A: BumpAllocSafe, B: BumpAllocSafe> BumpAllocSafe for (A, B)
[src]
impl<A: BumpAllocSafe, B: BumpAllocSafe> BumpAllocSafe for (A, B)
impl<A: BumpAllocSafe, B: BumpAllocSafe, C: BumpAllocSafe> BumpAllocSafe for (A, B, C)
[src]
impl<A: BumpAllocSafe, B: BumpAllocSafe, C: BumpAllocSafe> BumpAllocSafe for (A, B, C)
impl<A: BumpAllocSafe, B: BumpAllocSafe, C: BumpAllocSafe, D: BumpAllocSafe> BumpAllocSafe for (A, B, C, D)
[src]
impl<A: BumpAllocSafe, B: BumpAllocSafe, C: BumpAllocSafe, D: BumpAllocSafe> BumpAllocSafe for (A, B, C, D)
impl<A: BumpAllocSafe, B: BumpAllocSafe, C: BumpAllocSafe, D: BumpAllocSafe, E: BumpAllocSafe> BumpAllocSafe for (A, B, C, D, E)
[src]
impl<A: BumpAllocSafe, B: BumpAllocSafe, C: BumpAllocSafe, D: BumpAllocSafe, E: BumpAllocSafe> BumpAllocSafe for (A, B, C, D, E)
impl<A: BumpAllocSafe, B: BumpAllocSafe, C: BumpAllocSafe, D: BumpAllocSafe, E: BumpAllocSafe, F: BumpAllocSafe> BumpAllocSafe for (A, B, C, D, E, F)
[src]
impl<A: BumpAllocSafe, B: BumpAllocSafe, C: BumpAllocSafe, D: BumpAllocSafe, E: BumpAllocSafe, F: BumpAllocSafe> BumpAllocSafe for (A, B, C, D, E, F)
impl<A: BumpAllocSafe, B: BumpAllocSafe, C: BumpAllocSafe, D: BumpAllocSafe, E: BumpAllocSafe, F: BumpAllocSafe, G: BumpAllocSafe> BumpAllocSafe for (A, B, C, D, E, F, G)
[src]
impl<A: BumpAllocSafe, B: BumpAllocSafe, C: BumpAllocSafe, D: BumpAllocSafe, E: BumpAllocSafe, F: BumpAllocSafe, G: BumpAllocSafe> BumpAllocSafe for (A, B, C, D, E, F, G)
impl<A: BumpAllocSafe, B: BumpAllocSafe, C: BumpAllocSafe, D: BumpAllocSafe, E: BumpAllocSafe, F: BumpAllocSafe, G: BumpAllocSafe, H: BumpAllocSafe> BumpAllocSafe for (A, B, C, D, E, F, G, H)
[src]
impl<A: BumpAllocSafe, B: BumpAllocSafe, C: BumpAllocSafe, D: BumpAllocSafe, E: BumpAllocSafe, F: BumpAllocSafe, G: BumpAllocSafe, H: BumpAllocSafe> BumpAllocSafe for (A, B, C, D, E, F, G, H)
impl<A: BumpAllocSafe, B: BumpAllocSafe, C: BumpAllocSafe, D: BumpAllocSafe, E: BumpAllocSafe, F: BumpAllocSafe, G: BumpAllocSafe, H: BumpAllocSafe, I: BumpAllocSafe> BumpAllocSafe for (A, B, C, D, E, F, G, H, I)
[src]
impl<A: BumpAllocSafe, B: BumpAllocSafe, C: BumpAllocSafe, D: BumpAllocSafe, E: BumpAllocSafe, F: BumpAllocSafe, G: BumpAllocSafe, H: BumpAllocSafe, I: BumpAllocSafe> BumpAllocSafe for (A, B, C, D, E, F, G, H, I)
impl<A: BumpAllocSafe, B: BumpAllocSafe, C: BumpAllocSafe, D: BumpAllocSafe, E: BumpAllocSafe, F: BumpAllocSafe, G: BumpAllocSafe, H: BumpAllocSafe, I: BumpAllocSafe, J: BumpAllocSafe> BumpAllocSafe for (A, B, C, D, E, F, G, H, I, J)
[src]
impl<A: BumpAllocSafe, B: BumpAllocSafe, C: BumpAllocSafe, D: BumpAllocSafe, E: BumpAllocSafe, F: BumpAllocSafe, G: BumpAllocSafe, H: BumpAllocSafe, I: BumpAllocSafe, J: BumpAllocSafe> BumpAllocSafe for (A, B, C, D, E, F, G, H, I, J)
impl<T> BumpAllocSafe for [T; 0]
[src]
impl<T> BumpAllocSafe for [T; 0]
impl<T> BumpAllocSafe for [T; 1]
[src]
impl<T> BumpAllocSafe for [T; 1]
impl<T> BumpAllocSafe for [T; 2]
[src]
impl<T> BumpAllocSafe for [T; 2]
impl<T> BumpAllocSafe for [T; 3]
[src]
impl<T> BumpAllocSafe for [T; 3]
impl<T> BumpAllocSafe for [T; 4]
[src]
impl<T> BumpAllocSafe for [T; 4]
impl<T> BumpAllocSafe for [T; 5]
[src]
impl<T> BumpAllocSafe for [T; 5]
impl<T> BumpAllocSafe for [T; 6]
[src]
impl<T> BumpAllocSafe for [T; 6]
impl<T> BumpAllocSafe for [T; 7]
[src]
impl<T> BumpAllocSafe for [T; 7]
impl<T> BumpAllocSafe for [T; 8]
[src]
impl<T> BumpAllocSafe for [T; 8]
impl<T> BumpAllocSafe for [T; 9]
[src]
impl<T> BumpAllocSafe for [T; 9]
impl<T> BumpAllocSafe for [T; 10]
[src]
impl<T> BumpAllocSafe for [T; 10]
impl<T> BumpAllocSafe for [T; 11]
[src]
impl<T> BumpAllocSafe for [T; 11]
impl<T> BumpAllocSafe for [T; 12]
[src]
impl<T> BumpAllocSafe for [T; 12]
impl<T> BumpAllocSafe for [T; 13]
[src]
impl<T> BumpAllocSafe for [T; 13]
impl<T> BumpAllocSafe for [T; 14]
[src]
impl<T> BumpAllocSafe for [T; 14]
impl<T> BumpAllocSafe for [T; 15]
[src]
impl<T> BumpAllocSafe for [T; 15]
impl<T> BumpAllocSafe for [T; 16]
[src]
impl<T> BumpAllocSafe for [T; 16]
impl<T> BumpAllocSafe for [T; 17]
[src]
impl<T> BumpAllocSafe for [T; 17]
impl<T> BumpAllocSafe for [T; 18]
[src]
impl<T> BumpAllocSafe for [T; 18]
impl<T> BumpAllocSafe for [T; 19]
[src]
impl<T> BumpAllocSafe for [T; 19]
impl<T> BumpAllocSafe for [T; 20]
[src]
impl<T> BumpAllocSafe for [T; 20]
impl<T> BumpAllocSafe for [T; 21]
[src]
impl<T> BumpAllocSafe for [T; 21]
impl<T> BumpAllocSafe for [T; 22]
[src]
impl<T> BumpAllocSafe for [T; 22]
impl<T> BumpAllocSafe for [T; 23]
[src]
impl<T> BumpAllocSafe for [T; 23]
impl<T> BumpAllocSafe for [T; 24]
[src]
impl<T> BumpAllocSafe for [T; 24]
impl<T> BumpAllocSafe for [T; 25]
[src]
impl<T> BumpAllocSafe for [T; 25]
impl<T> BumpAllocSafe for [T; 26]
[src]
impl<T> BumpAllocSafe for [T; 26]
impl<T> BumpAllocSafe for [T; 27]
[src]
impl<T> BumpAllocSafe for [T; 27]
impl<T> BumpAllocSafe for [T; 28]
[src]
impl<T> BumpAllocSafe for [T; 28]
impl<T> BumpAllocSafe for [T; 29]
[src]
impl<T> BumpAllocSafe for [T; 29]
impl<T> BumpAllocSafe for [T; 30]
[src]
impl<T> BumpAllocSafe for [T; 30]
impl<T> BumpAllocSafe for [T; 31]
[src]
impl<T> BumpAllocSafe for [T; 31]
impl<T> BumpAllocSafe for [T; 32]
[src]
Loading content...
impl<T> BumpAllocSafe for [T; 32]