#[non_exhaustive]pub enum Layout {
Auto,
Single,
Direct,
}Expand description
How the generated trampoline holds the item (layout = .., advanced).
The default, Layout::Auto, is the right choice almost always.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Auto
Layout::Direct for a small item, Layout::Single for a large one
(more than SINGLE_COPY_THRESHOLD
tokens with its META).
Single
The item is held once, so the macro’s metadata is about the size of one item, and one call takes three expansions (two through the derive route) instead of one.
Direct
One expansion per call; the item is copied into each of the macro’s three output arms.
Trait Implementations§
impl Copy for Layout
impl Eq for Layout
impl StructuralPartialEq for Layout
Auto Trait Implementations§
impl Freeze for Layout
impl RefUnwindSafe for Layout
impl Send for Layout
impl Sync for Layout
impl Unpin for Layout
impl UnsafeUnpin for Layout
impl UnwindSafe for Layout
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