pub struct Offset<S>where
S: Scale,{ /* private fields */ }Expand description
An offset counted in a specific Scale.
The phantom parameter is the whole point: Offset<Bytes> and
Offset<Chars> are distinct types, so the substitution that produced a
wrong column for every non-ASCII user is now E0308.
raw() is deliberately the ONLY way out. Reaching for it is the moment to
ask which scale the consumer wants, which is exactly the question the bare
usize let everyone skip.
Implementations§
Trait Implementations§
impl<S> Copy for Offset<S>where
S: Scale,
impl<S> Eq for Offset<S>
Source§impl<S> Ord for Offset<S>
impl<S> Ord for Offset<S>
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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl<S> PartialOrd for Offset<S>where
S: PartialOrd + Scale,
impl<S> PartialOrd for Offset<S>where
S: PartialOrd + Scale,
impl<S> StructuralPartialEq for Offset<S>
Auto Trait Implementations§
impl<S> Freeze for Offset<S>where
PhantomData<S>: Freeze,
impl<S> RefUnwindSafe for Offset<S>where
PhantomData<S>: RefUnwindSafe,
impl<S> Send for Offset<S>where
PhantomData<S>: Send,
impl<S> Sync for Offset<S>where
PhantomData<S>: Sync,
impl<S> Unpin for Offset<S>where
PhantomData<S>: Unpin,
impl<S> UnsafeUnpin for Offset<S>where
PhantomData<S>: UnsafeUnpin,
impl<S> UnwindSafe for Offset<S>where
PhantomData<S>: 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