pub struct Signed<T: Sized + Copy> { /* private fields */ }Expand description
Struct which recognizes signed integer values. This special case has been build for Yjs encoding
compatibility, which recognizes differences between 0 and -0, which is used in some
cases (eg. UIntOptRleDecoder).
Implementations§
source§impl<T: Sized + Copy> Signed<T>
impl<T: Sized + Copy> Signed<T>
pub fn new(value: T, is_negative: bool) -> Self
sourcepub fn is_positive(&self) -> bool
pub fn is_positive(&self) -> bool
Returns true is stored number is a positive value.
sourcepub fn is_negative(&self) -> bool
pub fn is_negative(&self) -> bool
Returns true is stored number is a negative value (including -0 as a special case).
Trait Implementations§
source§impl<T: PartialEq + Sized + Copy> PartialEq for Signed<T>
impl<T: PartialEq + Sized + Copy> PartialEq for Signed<T>
impl<T: Eq + Sized + Copy> Eq for Signed<T>
impl<T: Sized + Copy> StructuralEq for Signed<T>
impl<T: Sized + Copy> StructuralPartialEq for Signed<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Signed<T>where T: RefUnwindSafe,
impl<T> Send for Signed<T>where T: Send,
impl<T> Sync for Signed<T>where T: Sync,
impl<T> Unpin for Signed<T>where T: Unpin,
impl<T> UnwindSafe for Signed<T>where T: 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