[−][src]Union high_mem_utils::CatchSeq
An union slice that can be leaked or sealed(owned),useful when you want to give temporal global access to a particular sequence.
Methods
impl<'a, T> CatchSeq<'a, T>
[src]
pub fn new(a: Vec<T>) -> Self
[src]
Creates a new CatchSeq with a leak, you can lately get the underlying sequence and consume the CatchSeq
with the seal
method.
pub fn leaked(&self) -> &&'a mut [T]
[src]
Returns a a reference to the leaked field,as the only safe ways for construct this union returns a leaked one,for warranty never transmute stack to heap data,this method does not use transmute implicitly.
pub fn seal(self) -> Vec<T>
[src]
Consumes the Catch and gets the inner Vec
This does a call to transmute but,as the only safe ways for construct this union returns a leaked one,this never trigger undefined behavior by itself.
pub fn leak(self) -> &'a mut [T]
[src]
Consumes the CatchSeq and returns a mutable reference pointing to leaked data.
pub unsafe fn from_leaked(leaked: &'a mut [T]) -> Self
[src]
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for CatchSeq<'a, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, T> Send for CatchSeq<'a, T> where
T: Send,
T: Send,
impl<'a, T> Sync for CatchSeq<'a, T> where
T: Sync,
T: Sync,
impl<'a, T> Unpin for CatchSeq<'a, T>
impl<'a, T> !UnwindSafe for CatchSeq<'a, T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,