pub struct Binary;Expand description
A 1-bit binary quantization mapping -1 to 0 and 1 to 1.
Trait Implementations§
Source§impl Representation<1> for Binary
impl Representation<1> for Binary
Source§fn encode(value: i64) -> Result<u8, EncodingError>
fn encode(value: i64) -> Result<u8, EncodingError>
Encode
value into the lower order bits of a byte. Returns the encoded value on
success, or an EncodingError if the value is unencodable.Source§fn encode_unchecked(value: i64) -> u8
fn encode_unchecked(value: i64) -> u8
Encode
value into the lower order bits of a byte without checking if value
is encodable. This function is not marked as unsafe because in-and-of itself, it
won’t cause memory safety issues. Read moreimpl Copy for Binary
Auto Trait Implementations§
impl Freeze for Binary
impl RefUnwindSafe for Binary
impl Send for Binary
impl Sync for Binary
impl Unpin for Binary
impl UnwindSafe for Binary
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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