Struct git_repository::config::Integer
pub struct Integer {
pub value: i64,
pub suffix: Option<Suffix>,
}
Expand description
Any value that can be interpreted as an integer.
This supports any numeric value that can fit in a i64
, excluding the
suffix. The suffix is parsed separately from the value itself, so if you
wish to obtain the true value of the integer, you must account for the
suffix after fetching the value. integer::Suffix
provides
bitwise_offset()
to help with the
math, or to_decimal() for obtaining a usable value in one step.
Fields§
§value: i64
The value, without any suffix modification
suffix: Option<Suffix>
A provided suffix, if any.
Implementations§
§impl Integer
impl Integer
pub fn to_decimal(&self) -> Option<i64>
pub fn to_decimal(&self) -> Option<i64>
Canonicalize values as simple decimal numbers. An optional suffix of k, m, or g (case-insensitive), will cause the value to be multiplied by 1024 (k), 1048576 (m), or 1073741824 (g) respectively.
Returns the result if there is no multiplication overflow.
Trait Implementations§
§impl Ord for Integer
impl Ord for Integer
§impl PartialOrd<Integer> for Integer
impl PartialOrd<Integer> for Integer
§fn partial_cmp(&self, other: &Integer) -> Option<Ordering>
fn partial_cmp(&self, other: &Integer) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Integer
impl Eq for Integer
impl StructuralEq for Integer
impl StructuralPartialEq for Integer
Auto Trait Implementations§
impl RefUnwindSafe for Integer
impl Send for Integer
impl Sync for Integer
impl Unpin for Integer
impl UnwindSafe for Integer
Blanket Implementations§
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere T: Display,
§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a [
CompactString
]. Read more