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
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>
impl<S> RefUnwindSafe for Offset<S>where
S: RefUnwindSafe,
impl<S> Send for Offset<S>where
S: Send,
impl<S> Sync for Offset<S>where
S: Sync,
impl<S> Unpin for Offset<S>where
S: Unpin,
impl<S> UnsafeUnpin for Offset<S>
impl<S> UnwindSafe for Offset<S>where
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