File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -373,6 +373,16 @@ impl<'s> CheckedHrpstring<'s> {
373
373
#[ inline]
374
374
pub fn data_part_ascii_no_checksum ( & self ) -> & [ u8 ] { self . ascii }
375
375
376
+ /// Returns an iterator that yields the data part of the parsed bech32 encoded string as [`Fe32`]s.
377
+ ///
378
+ /// Converts the ASCII bytes representing field elements to the respective field elements.
379
+ #[ inline]
380
+ pub fn fe32_iter < I : Iterator < Item = u8 > > (
381
+ & self ,
382
+ ) -> AsciiToFe32Iter < iter:: Copied < slice:: Iter < ' s , u8 > > > {
383
+ AsciiToFe32Iter { iter : self . ascii . iter ( ) . copied ( ) }
384
+ }
385
+
376
386
/// Returns an iterator that yields the data part of the parsed bech32 encoded string.
377
387
///
378
388
/// Converts the ASCII bytes representing field elements to the respective field elements, then
@@ -658,14 +668,14 @@ impl<'s> Iterator for Fe32Iter<'s> {
658
668
fn size_hint ( & self ) -> ( usize , Option < usize > ) { self . iter . size_hint ( ) }
659
669
}
660
670
661
- /// Helper iterator adaptor that maps an iterator of valid bech32 character ASCII bytes to an
671
+ /// Iterator adaptor that maps an iterator of valid bech32 character ASCII bytes to an
662
672
/// iterator of field elements.
663
673
///
664
674
/// # Panics
665
675
///
666
676
/// If any `u8` in the input iterator is out of range for an [`Fe32`]. Should only be used on data
667
677
/// that has already been checked for validity (eg, by using `check_characters`).
668
- struct AsciiToFe32Iter < I : Iterator < Item = u8 > > {
678
+ pub struct AsciiToFe32Iter < I : Iterator < Item = u8 > > {
669
679
iter : I ,
670
680
}
671
681
You can’t perform that action at this time.
0 commit comments