pub enum EscapeInfo {
NoEscape,
LocalEscape,
GlobalEscape,
}Expand description
The escape status of a closure or variable.
Variants§
NoEscape
The value does not escape its defining scope. It can be stack-allocated.
LocalEscape
The value escapes within the current function (e.g. stored in a local data structure) but does not escape the function itself.
GlobalEscape
The value escapes the function (e.g. returned, stored in a global, or passed to an unknown function). Must be heap-allocated.
Implementations§
Source§impl EscapeInfo
impl EscapeInfo
Sourcepub fn merge(self, other: EscapeInfo) -> EscapeInfo
pub fn merge(self, other: EscapeInfo) -> EscapeInfo
Merge two escape infos, taking the more conservative (higher) one.
Sourcepub fn requires_heap(self) -> bool
pub fn requires_heap(self) -> bool
Whether heap allocation is required.
Trait Implementations§
Source§impl Clone for EscapeInfo
impl Clone for EscapeInfo
Source§fn clone(&self) -> EscapeInfo
fn clone(&self) -> EscapeInfo
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 EscapeInfo
impl Debug for EscapeInfo
Source§impl Display for EscapeInfo
impl Display for EscapeInfo
Source§impl Hash for EscapeInfo
impl Hash for EscapeInfo
Source§impl Ord for EscapeInfo
impl Ord for EscapeInfo
Source§fn cmp(&self, other: &EscapeInfo) -> Ordering
fn cmp(&self, other: &EscapeInfo) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for EscapeInfo
impl PartialEq for EscapeInfo
Source§impl PartialOrd for EscapeInfo
impl PartialOrd for EscapeInfo
impl Copy for EscapeInfo
impl Eq for EscapeInfo
impl StructuralPartialEq for EscapeInfo
Auto Trait Implementations§
impl Freeze for EscapeInfo
impl RefUnwindSafe for EscapeInfo
impl Send for EscapeInfo
impl Sync for EscapeInfo
impl Unpin for EscapeInfo
impl UnsafeUnpin for EscapeInfo
impl UnwindSafe for EscapeInfo
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