File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ use core:: num:: ParseIntError ;
2+
13use crate :: { PrimitiveError , PrimitiveNumber , PrimitiveNumberRef } ;
24
35/// Trait for all primitive [integer types], including the supertrait [`PrimitiveNumber`].
@@ -264,6 +266,9 @@ pub trait PrimitiveInteger:
264266 /// Converts an integer from little endian to the target's endianness.
265267 fn from_le ( value : Self ) -> Self ;
266268
269+ /// Parses an integer from a string slice with digits in a given base.
270+ fn from_str_radix ( src : & str , radix : u32 ) -> Result < Self , ParseIntError > ;
271+
267272 /// Returns the logarithm of the number with respect to an arbitrary base, rounded down.
268273 fn ilog ( self , base : Self ) -> u32 ;
269274
@@ -582,6 +587,7 @@ macro_rules! impl_integer {
582587 forward! {
583588 fn from_be( value: Self ) -> Self ;
584589 fn from_le( value: Self ) -> Self ;
590+ fn from_str_radix( src: & str , radix: u32 ) -> Result <Self , ParseIntError >;
585591 }
586592 forward! {
587593 fn checked_add( self , rhs: Self ) -> Option <Self >;
You can’t perform that action at this time.
0 commit comments