pub struct AlignedOffset(/* private fields */);Expand description
An unsigned offset that is maximally aligned.
Implementations§
Source§impl AlignedOffset
impl AlignedOffset
Sourcepub fn next_up(self, bytes: usize) -> Option<Self>
pub fn next_up(self, bytes: usize) -> Option<Self>
Get the next valid offset after adding bytes to this.
use image_texel::layout::AlignedOffset;
let zero = AlignedOffset::default();
assert_eq!(zero.next_up(0), Some(zero));
assert_eq!(zero.next_up(1), zero.next_up(2));
assert!(zero.next_up(usize::MAX).is_none());
assert!(zero.next_up(isize::MAX as usize).is_none());Trait Implementations§
Source§impl Clone for AlignedOffset
impl Clone for AlignedOffset
Source§fn clone(&self) -> AlignedOffset
fn clone(&self) -> AlignedOffset
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for AlignedOffset
Source§impl Debug for AlignedOffset
impl Debug for AlignedOffset
Source§impl Default for AlignedOffset
impl Default for AlignedOffset
Source§fn default() -> AlignedOffset
fn default() -> AlignedOffset
Returns the “default value” for a type. Read more
impl Eq for AlignedOffset
Source§impl Ord for AlignedOffset
impl Ord for AlignedOffset
Source§fn cmp(&self, other: &AlignedOffset) -> Ordering
fn cmp(&self, other: &AlignedOffset) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for AlignedOffset
impl PartialEq for AlignedOffset
Source§fn eq(&self, other: &AlignedOffset) -> bool
fn eq(&self, other: &AlignedOffset) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for AlignedOffset
impl PartialOrd for AlignedOffset
impl StructuralPartialEq for AlignedOffset
Auto Trait Implementations§
impl Freeze for AlignedOffset
impl RefUnwindSafe for AlignedOffset
impl Send for AlignedOffset
impl Sync for AlignedOffset
impl Unpin for AlignedOffset
impl UnsafeUnpin for AlignedOffset
impl UnwindSafe for AlignedOffset
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