pub trait UnsignedIntoSigned: Copy + Sized {
type Signed;
// Required methods
fn into_positive(self) -> Self::Signed;
fn into_negative(self) -> Self::Signed;
// Provided method
fn into_signed(self, sign: i32) -> Self::Signed { ... }
}
Expand description
A trait implemented on unsigned types which can be converted into crate::Signed
s.
Required Associated Types§
Required Methods§
Sourcefn into_positive(self) -> Self::Signed
fn into_positive(self) -> Self::Signed
Converts self
into a Signed::Positive
.
Sourcefn into_negative(self) -> Self::Signed
fn into_negative(self) -> Self::Signed
Converts self
into a Signed::Negative
.
Provided Methods§
Sourcefn into_signed(self, sign: i32) -> Self::Signed
fn into_signed(self, sign: i32) -> Self::Signed
Converts self
into a Signed
matching the given sign
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.