[][src]Struct pebble_skip::Box

pub struct Box<'a, T: ?Sized>(_);

Just a standard Box, more or less. The main difference is that its constructor is fallible instead of panicking.

It probably has fewer features than Rust's version, but it should be possible to add or emulate those.

Implementations

impl<'a, T> Box<'a, T>[src]

pub fn new(value: T) -> Result<Self, T>[src]

Moves value onto the Pebble heap.

Errors

Iff the heap allocation fails.

#[must_use]pub fn into_inner(r#box: Self) -> T[src]

Moves r#box's value off the Pebble heap.

impl<'a> Box<'a, [MaybeUninit<u8>]>[src]

pub fn new_buffer_uninit(len: usize) -> Result<Self, ()>[src]

Errors

Iff not enough heap memory could be allocated.

#[must_use]pub fn assume_init(r#box: Self) -> Box<'a, [u8]>

Notable traits for Box<'a, F>

impl<'a, F: ?Sized + Future + Unpin> Future for Box<'a, F> type Output = F::Output;
[src]

impl<'a, T: ?Sized> Box<'a, T>[src]

#[must_use = "If the Box instance is not reassembled later, a memory leak occurs."]pub fn leak(r#box: Self) -> &'a mut T where
    T: 'a, 
[src]

pub unsafe fn from_raw(raw: &'a mut T) -> Self[src]

Reassembles a Box instance from a leaked reference.

Safety

Iff the reference was previously leaked from a matching Box instance.

#[must_use]pub unsafe fn downcast_unchecked<U: Unsize<T>>(r#box: Self) -> Box<'a, U>

Notable traits for Box<'a, F>

impl<'a, F: ?Sized + Future + Unpin> Future for Box<'a, F> type Output = F::Output;
[src]

Reinterprets a Box of an type T into its original sized type Box<U>.

Safety

Iff this instance was created from a value memory-compatible to U.

impl Box<'static, CStr<Heap>>[src]

pub fn clone_to_c_str(value: &str) -> Result<Self, ()>[src]

Clones a Rust str onto the Pebble heap, appending '\0' in the process.

Errors

Iff the heap allocation fails.

Trait Implementations

impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Box<'a, U>> for Box<'a, T>[src]

impl<'a, T: ?Sized> Deref for Box<'a, T>[src]

type Target = T

The resulting type after dereferencing.

impl<'a, T: ?Sized> DerefMut for Box<'a, T>[src]

impl<'a, T: ?Sized> Drop for Box<'a, T>[src]

impl<'a> From<Box<'a, CStr<Heap>>> for Box<'a, str>[src]

impl<'a, F: ?Sized + Future + Unpin> Future for Box<'a, F>[src]

type Output = F::Output

The type of value produced on completion.

impl<'a> TryFrom<Box<'a, str>> for Box<'a, CStr<Heap>>[src]

type Error = ()

The type returned in the event of a conversion error.

impl<'a, T: ?Sized> Unpin for Box<'a, T>[src]

Auto Trait Implementations

impl<'a, T: ?Sized> Send for Box<'a, T> where
    T: Send

impl<'a, T: ?Sized> Sync for Box<'a, T> where
    T: Sync

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<F> IntoFuture for F where
    F: Future
[src]

type Output = <F as Future>::Output

🔬 This is a nightly-only experimental API. (into_future)

The output that the future will produce on completion.

type Future = F

🔬 This is a nightly-only experimental API. (into_future)

Which kind of future are we turning this into?

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.