Enum core_extensions::integers::Sign
source · [−]pub enum Sign {
Positive,
Negative,
}
integers
only.Expand description
Represents the signedness of an integer
Variants
Positive
Positive integer
Negative
Negative integer
Implementations
sourceimpl Sign
impl Sign
sourcepub const fn sign_len(self) -> usize
pub const fn sign_len(self) -> usize
How long the string representation of this sign is.
Example
use core_extensions::integers::Sign;
assert_eq!(Sign::Positive.sign_len(), 0);
assert_eq!(Sign::Negative.sign_len(), 1);
sourcepub const fn sign_string(self) -> &'static str
pub const fn sign_string(self) -> &'static str
The string representation of this sign.
Example
use core_extensions::integers::Sign;
assert_eq!(Sign::Positive.sign_string(), "");
assert_eq!(Sign::Negative.sign_string(), "-");
Trait Implementations
sourceimpl PartialEq<Sign> for Sign
impl PartialEq<Sign> for Sign
impl Copy for Sign
impl Eq for Sign
impl StructuralEq for Sign
impl StructuralPartialEq for Sign
Auto Trait Implementations
impl RefUnwindSafe for Sign
impl Send for Sign
impl Sync for Sign
impl Unpin for Sign
impl UnwindSafe for Sign
Blanket Implementations
sourceimpl<T> AsPhantomData for T where
T: ?Sized,
impl<T> AsPhantomData for T where
T: ?Sized,
sourcefn as_phantom(&self) -> PhantomData<Self>
fn as_phantom(&self) -> PhantomData<Self>
phantom
only.Gets a PhantomData<Self>
. Read more
sourcefn as_phantom_covariant(&self) -> PhantomData<fn() -> Self>
fn as_phantom_covariant(&self) -> PhantomData<fn() -> Self>
phantom
only.Gets a PhantomData<fn() -> Self>
, a covariant PhantomData
.
sourcefn as_phantom_contra(&self) -> PhantomData<fn(_: Self)>
fn as_phantom_contra(&self) -> PhantomData<fn(_: Self)>
phantom
only.Gets a PhantomData<fn(Self)>
, a contravariant PhantomData
.
sourcefn as_phantom_invariant(&self) -> PhantomData<fn(_: Self) -> Self>
fn as_phantom_invariant(&self) -> PhantomData<fn(_: Self) -> Self>
phantom
only.Gets a PhantomData<fn(Self) -> Self>
, an invariant PhantomData
.
sourceconst PHANTOM: PhantomData<Self> = PhantomData
const PHANTOM: PhantomData<Self> = PhantomData
phantom
only.Gets a PhantomData<Self>
. Read more
sourceconst PHANTOM_COVARIANT: PhantomData<fn() -> Self> = PhantomData
const PHANTOM_COVARIANT: PhantomData<fn() -> Self> = PhantomData
phantom
only.Constructs a PhantomData<fn() -> T>
, a covariant PhantomData
. Read more
sourceconst PHANTOM_CONTRA: PhantomData<fn(_: Self)> = PhantomData
const PHANTOM_CONTRA: PhantomData<fn(_: Self)> = PhantomData
phantom
only.Gets a PhantomData<fn(Self)>
, a contravariant PhantomData
. Read more
sourceconst PHANTOM_INVARIANT: PhantomData<fn(_: Self) -> Self> = PhantomData
const PHANTOM_INVARIANT: PhantomData<fn(_: Self) -> Self> = PhantomData
phantom
only.Gets a PhantomData<fn(Self) -> Self>
, an invariant PhantomData
. Read more
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CallExt for T where
T: ?Sized,
impl<T> CallExt for T where
T: ?Sized,
sourcefn ref_call<P>(&self, params: P) -> Self::Returns where
Self: CallRef<P>,
fn ref_call<P>(&self, params: P) -> Self::Returns where
Self: CallRef<P>,
callable
only.For calling CallRef::ref_call_
,
with the ability to specify the types of the arguments.. Read more