pub struct Item<T> {
pub data: T,
pub w: usize,
pub h: usize,
pub rot: Rotation,
}Expand description
An item to be packed by Packer.
Fields§
§data: TData associated with the item (for example, an ID or a reference to an image).
w: usizeThe item’s width.
h: usizeThe item’s height.
rot: RotationThe item may be rotated 90° to fit better.
Allowing rotation slows down the algorithm, because the item
will try to pack using both (w, h) and (h, w) as its size
But this can lead to more efficiently packed results.
If an item is square, it will never be rotated.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Item<T>where
T: Freeze,
impl<T> RefUnwindSafe for Item<T>where
T: RefUnwindSafe,
impl<T> Send for Item<T>where
T: Send,
impl<T> Sync for Item<T>where
T: Sync,
impl<T> Unpin for Item<T>where
T: Unpin,
impl<T> UnwindSafe for Item<T>where
T: UnwindSafe,
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