pub struct Relocated<T> {
pub offset: AlignedOffset,
pub inner: T,
}Expand description
Moves a base layout to an aligned offset location.
This effectively allows turning one layout into a plane of another.
Fields§
§offset: AlignedOffset§inner: TImplementations§
Source§impl<T: Layout> Relocated<T>
impl<T: Layout> Relocated<T>
pub fn new(inner: T) -> Self
Sourcepub fn next_aligned_offset(&self) -> Option<AlignedOffset>
pub fn next_aligned_offset(&self) -> Option<AlignedOffset>
Get the next aligned offset that comes after this relocated layout.
Sourcepub fn texel_range(&self) -> TexelRange<T::Sample>where
T: SliceLayout,
pub fn texel_range(&self) -> TexelRange<T::Sample>where
T: SliceLayout,
Get an index addressing all samples covered by the range of this relocated layout.
Trait Implementations§
impl<T: Copy> Copy for Relocated<T>
impl<T: Eq> Eq for Relocated<T>
Source§impl<T: PartialEq> PartialEq for Relocated<T>
impl<T: PartialEq> PartialEq for Relocated<T>
Source§impl<T: Layout> Relocate for Relocated<T>
impl<T: Layout> Relocate for Relocated<T>
Source§fn byte_offset(&self) -> usize
fn byte_offset(&self) -> usize
The offset of the first relevant byte of this layout. Read more
Source§fn relocate(&mut self, offset: AlignedOffset)
fn relocate(&mut self, offset: AlignedOffset)
Move the layout to another aligned offset. Read more
Source§fn relocate_to_byte(&mut self, offset: usize) -> bool
fn relocate_to_byte(&mut self, offset: usize) -> bool
Attempt to relocate the offset to another start offset, in bytes. Read more
Source§fn byte_range(&self) -> Range<usize>
fn byte_range(&self) -> Range<usize>
Retrieve the contiguous byte range occupied by this layout.
impl<T> StructuralPartialEq for Relocated<T>
Auto Trait Implementations§
impl<T> Freeze for Relocated<T>where
T: Freeze,
impl<T> RefUnwindSafe for Relocated<T>where
T: RefUnwindSafe,
impl<T> Send for Relocated<T>where
T: Send,
impl<T> Sync for Relocated<T>where
T: Sync,
impl<T> Unpin for Relocated<T>where
T: Unpin,
impl<T> UnsafeUnpin for Relocated<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Relocated<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