Expand description
General Wrapper for References within either of the crate’s Stack Allocators: the StackFrameDictAllocator, and the StackFrameAllocator. Grabbing values from a StackFrameDictAllocator gives you unsafe_ref::StackRef’s because mutltiple StackRefs can be obtained which all point to the same value, thus you could make multiple mutable references to the same value which violates the rules of the borrow checker. Grabbing values from a StackFrameAllocator gives you safe_ref::StackRef’s because only one StackRef can point to a value at any given time, which means the borrow checker can validate that borrowing rules are being followed. There is also a static guarantee that the lifetime of a StackRef is the same lifetime of the Frame of the Value the StackRef is pointing to.
Modules§
- safe_ref 
- Logic for StackRef where grabbing a mutable reference is safe, and borrowing rules are validated at compile time by the borrow checker. StackRefs grabbed from a [StackFrameAllocator] will be safe_ref::StackRef
- unsafe_ref 
- Logic for StackRef where grabbing a mutable reference can potentially be unsafe, because it is impossible for the borrow checker to validate borrowing rules at compile time. StackRefs grabbed from a [StackFrameDictAllocator] will be unsafe_ref::StackRef