pub struct PixelHash(/* private fields */);Expand description
Represents a 8-byte hash.
Implementations§
Source§impl PixelHash
impl PixelHash
Sourcepub fn to_signed(self) -> i64
pub fn to_signed(self) -> i64
Converts the PixelHash into a signed 64-bit integer.
This function takes the PixelHash instance and interprets it as
an unsigned 64-bit integer, then converts it to a signed 64-bit
integer using a bitwise XOR with a fixed value. This transformation
ensures that the conversion covers the full range of a signed
64-bit integer and can be used for comparison and sorting operations.
§Returns
An i64 value which represents the signed integer interpretation
of the PixelHash.
Sourcepub fn from_signed(v: i64) -> Self
pub fn from_signed(v: i64) -> Self
Converts a signed 64-bit integer back into a PixelHash.
This function interprets the signed integer as a transformed pixel hash,
reversing the transformation done by to_signed. The conversion back to
a PixelHash is achieved by applying a bitwise XOR with a fixed value,
effectively reversing the previous transformation.
This method is useful for reconstructing a PixelHash from a signed
integer representation, especially in contexts where PixelHash values
are stored or sorted as signed integers.
§Arguments
v- Ani64that represents the signed integer interpretation of a pixel hash.
§Returns
A PixelHash constructed from the provided signed integer.
Trait Implementations§
impl Eq for PixelHash
impl StructuralPartialEq for PixelHash
Auto Trait Implementations§
impl Freeze for PixelHash
impl RefUnwindSafe for PixelHash
impl Send for PixelHash
impl Sync for PixelHash
impl Unpin for PixelHash
impl UnwindSafe for PixelHash
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more