Expand description
Layout of a tuple.
Examples
use varlen::prelude::*;
use varlen::Layout;
let mut t: VBox<Tup2<Str, Str>> = VBox::new(tup2::Init(
Str::copy("hello"),
Str::copy("world"),
));
assert_eq!(&t.refs().0[..], "hello");
assert_eq!(&t.refs().1[..], "world");
t.as_mut().muts().0.mut_slice().make_ascii_uppercase();
assert_eq!(&t.refs().0[..], "HELLO");
assert_eq!(&t.refs().1[..], "world");
assert_eq!(t.calculate_layout().size(),
core::mem::size_of::<usize>() * 2 + 8 /* hello */ + 5 /* world */);
Trait Implementations
Auto Trait Implementations
impl<A, B> RefUnwindSafe for Layout<A, B> where
<A as VarLen>::Layout: RefUnwindSafe,
<B as VarLen>::Layout: RefUnwindSafe,
impl<A, B> Send for Layout<A, B> where
<A as VarLen>::Layout: Send,
<B as VarLen>::Layout: Send,
impl<A, B> Sync for Layout<A, B> where
<A as VarLen>::Layout: Sync,
<B as VarLen>::Layout: Sync,
impl<A, B> Unpin for Layout<A, B> where
<A as VarLen>::Layout: Unpin,
<B as VarLen>::Layout: Unpin,
impl<A, B> UnwindSafe for Layout<A, B> where
<A as VarLen>::Layout: UnwindSafe,
<B as VarLen>::Layout: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more