Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/integer.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use core::num::ParseIntError;

use crate::{PrimitiveError, PrimitiveNumber, PrimitiveNumberRef};

/// Trait for all primitive [integer types], including the supertrait [`PrimitiveNumber`].
Expand Down Expand Up @@ -264,6 +266,9 @@ pub trait PrimitiveInteger:
/// Converts an integer from little endian to the target's endianness.
fn from_le(value: Self) -> Self;

/// Parses an integer from a string slice with digits in a given base.
fn from_str_radix(src: &str, radix: u32) -> Result<Self, ParseIntError>;

/// Returns the logarithm of the number with respect to an arbitrary base, rounded down.
fn ilog(self, base: Self) -> u32;

Expand Down Expand Up @@ -582,6 +587,7 @@ macro_rules! impl_integer {
forward! {
fn from_be(value: Self) -> Self;
fn from_le(value: Self) -> Self;
fn from_str_radix(src: &str, radix: u32) -> Result<Self, ParseIntError>;
}
forward! {
fn checked_add(self, rhs: Self) -> Option<Self>;
Expand Down