pub enum EscapeStatus {
NoEscape,
LocalEscape,
HeapEscape,
ReturnEscape,
ArgumentEscape(usize),
Unknown,
}Expand description
The escape status of an allocation site.
Variants§
NoEscape
The allocation does not escape: safe for stack allocation.
LocalEscape
The allocation escapes to a local variable only.
HeapEscape
The allocation escapes to the heap (assigned to a heap-allocated struct).
ReturnEscape
The allocation is returned from the function.
ArgumentEscape(usize)
The allocation escapes as argument index usize of some call.
Unknown
Escape status is unknown (conservative assumption).
Implementations§
Source§impl EscapeStatus
impl EscapeStatus
Sourcepub fn is_heap_allocated(&self) -> bool
pub fn is_heap_allocated(&self) -> bool
Returns true if this allocation must live on the heap.
Sourcepub fn can_stack_allocate(&self) -> bool
pub fn can_stack_allocate(&self) -> bool
Returns true if this allocation can be placed on the stack.
Trait Implementations§
Source§impl Clone for EscapeStatus
impl Clone for EscapeStatus
Source§fn clone(&self) -> EscapeStatus
fn clone(&self) -> EscapeStatus
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EscapeStatus
impl Debug for EscapeStatus
Source§impl Hash for EscapeStatus
impl Hash for EscapeStatus
Source§impl PartialEq for EscapeStatus
impl PartialEq for EscapeStatus
impl Eq for EscapeStatus
impl StructuralPartialEq for EscapeStatus
Auto Trait Implementations§
impl Freeze for EscapeStatus
impl RefUnwindSafe for EscapeStatus
impl Send for EscapeStatus
impl Sync for EscapeStatus
impl Unpin for EscapeStatus
impl UnsafeUnpin for EscapeStatus
impl UnwindSafe for EscapeStatus
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more