Tracking Issue for thin_box · Issue #92791 · rust-lang/rust (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

@yaahc

Description

@yaahc

Feature gate: #![feature(thin_box)]

This is a tracking issue for ThinBox for making heap allocated DSTs which only occupy 1 pointer on the stack.

Public API

Note: This API is expected to grow to match Box as necessary over time. The initial API is the minimum needed for basic usage for error handling.

pub struct ThinBox<T: ?Sized> { /* ... */ }

impl ThinBox { pub fn new(value: T) -> Self; }

impl<Dyn: ?Sized> ThinBox { pub fn new_unsize(value: T) -> Self where T: Unsize; }

impl<T: ?Sized + Debug> Debug for ThinBox { /* ... / } impl<T: ?Sized + Display> Display for ThinBox { / ... / } impl<T: ?Sized + Error> Error for ThinBox { / ... / } impl<T: ?Sized> Deref for ThinBox { type Target = T; / ... / } impl<T: ?Sized> DerefMut for ThinBox { / ... / } impl<T: ?Sized> Drop for ThinBox { / ... */ }

unsafe impl<T: ?Sized + Send> Send for ThinBox {} unsafe impl<T: ?Sized + Sync> Sync for ThinBox {}

Steps / History

Unresolved Questions