@@ -734,21 +734,21 @@ impl<'d> Iterator for BreakpadStackRecords<'d> {
734
734
/// > compactness.
735
735
///
736
736
/// The full documentation resides [here](https://chromium.googlesource.com/breakpad/breakpad/+/refs/heads/master/docs/symbol_files.md).
737
- pub struct BreakpadObject < ' d > {
737
+ pub struct BreakpadObject < ' data > {
738
738
id : DebugId ,
739
739
arch : Arch ,
740
- module : BreakpadModuleRecord < ' d > ,
741
- data : & ' d [ u8 ] ,
740
+ module : BreakpadModuleRecord < ' data > ,
741
+ data : & ' data [ u8 ] ,
742
742
}
743
743
744
- impl < ' d > BreakpadObject < ' d > {
744
+ impl < ' data > BreakpadObject < ' data > {
745
745
/// Tests whether the buffer could contain a Breakpad object.
746
746
pub fn test ( data : & [ u8 ] ) -> bool {
747
747
data. starts_with ( b"MODULE " )
748
748
}
749
749
750
750
/// Tries to parse a Breakpad object from the given slice.
751
- pub fn parse ( data : & ' d [ u8 ] ) -> Result < Self , BreakpadError > {
751
+ pub fn parse ( data : & ' data [ u8 ] ) -> Result < Self , BreakpadError > {
752
752
// Ensure that we do not read the entire file at once.
753
753
let header = if data. len ( ) > BREAKPAD_HEADER_CAP {
754
754
match str:: from_utf8 ( & data[ ..BREAKPAD_HEADER_CAP ] ) {
@@ -813,7 +813,7 @@ impl<'d> BreakpadObject<'d> {
813
813
/// This is the name of the original debug file that was used to create the Breakpad file. On
814
814
/// Windows, this will have a `.pdb` extension, on other platforms that name is likely
815
815
/// equivalent to the name of the code file (shared library or executable).
816
- pub fn name ( & self ) -> & ' d str {
816
+ pub fn name ( & self ) -> & ' data str {
817
817
self . module . name
818
818
}
819
819
@@ -836,14 +836,14 @@ impl<'d> BreakpadObject<'d> {
836
836
}
837
837
838
838
/// Returns an iterator over symbols in the public symbol table.
839
- pub fn symbols ( & self ) -> BreakpadSymbolIterator < ' d > {
839
+ pub fn symbols ( & self ) -> BreakpadSymbolIterator < ' data > {
840
840
BreakpadSymbolIterator {
841
841
records : self . public_records ( ) ,
842
842
}
843
843
}
844
844
845
845
/// Returns an ordered map of symbols in the symbol table.
846
- pub fn symbol_map ( & self ) -> SymbolMap < ' d > {
846
+ pub fn symbol_map ( & self ) -> SymbolMap < ' data > {
847
847
self . symbols ( ) . collect ( )
848
848
}
849
849
@@ -861,7 +861,7 @@ impl<'d> BreakpadObject<'d> {
861
861
/// Constructing this session will also work if the object does not contain debugging
862
862
/// information, in which case the session will be a no-op. This can be checked via
863
863
/// [`has_debug_info`](struct.BreakpadObject.html#method.has_debug_info).
864
- pub fn debug_session ( & self ) -> Result < BreakpadDebugSession < ' d > , BreakpadError > {
864
+ pub fn debug_session ( & self ) -> Result < BreakpadDebugSession < ' data > , BreakpadError > {
865
865
Ok ( BreakpadDebugSession {
866
866
file_map : self . file_map ( ) ,
867
867
func_records : self . func_records ( ) ,
@@ -879,55 +879,55 @@ impl<'d> BreakpadObject<'d> {
879
879
}
880
880
881
881
/// Returns an iterator over info records.
882
- pub fn info_records ( & self ) -> BreakpadInfoRecords < ' d > {
882
+ pub fn info_records ( & self ) -> BreakpadInfoRecords < ' data > {
883
883
BreakpadInfoRecords {
884
884
lines : Lines :: new ( self . data ) ,
885
885
finished : false ,
886
886
}
887
887
}
888
888
889
889
/// Returns an iterator over file records.
890
- pub fn file_records ( & self ) -> BreakpadFileRecords < ' d > {
890
+ pub fn file_records ( & self ) -> BreakpadFileRecords < ' data > {
891
891
BreakpadFileRecords {
892
892
lines : Lines :: new ( self . data ) ,
893
893
finished : false ,
894
894
}
895
895
}
896
896
897
897
/// Returns a map for file name lookups by id.
898
- pub fn file_map ( & self ) -> BreakpadFileMap < ' d > {
898
+ pub fn file_map ( & self ) -> BreakpadFileMap < ' data > {
899
899
self . file_records ( )
900
900
. filter_map ( Result :: ok)
901
901
. map ( |file| ( file. id , file. name ) )
902
902
. collect ( )
903
903
}
904
904
905
905
/// Returns an iterator over public symbol records.
906
- pub fn public_records ( & self ) -> BreakpadPublicRecords < ' d > {
906
+ pub fn public_records ( & self ) -> BreakpadPublicRecords < ' data > {
907
907
BreakpadPublicRecords {
908
908
lines : Lines :: new ( self . data ) ,
909
909
finished : false ,
910
910
}
911
911
}
912
912
913
913
/// Returns an iterator over function records.
914
- pub fn func_records ( & self ) -> BreakpadFuncRecords < ' d > {
914
+ pub fn func_records ( & self ) -> BreakpadFuncRecords < ' data > {
915
915
BreakpadFuncRecords {
916
916
lines : Lines :: new ( self . data ) ,
917
917
finished : false ,
918
918
}
919
919
}
920
920
921
921
/// Returns an iterator over stack frame records.
922
- pub fn stack_records ( & self ) -> BreakpadStackRecords < ' d > {
922
+ pub fn stack_records ( & self ) -> BreakpadStackRecords < ' data > {
923
923
BreakpadStackRecords {
924
924
lines : Lines :: new ( self . data ) ,
925
925
finished : false ,
926
926
}
927
927
}
928
928
929
929
/// Returns the raw data of the Breakpad file.
930
- pub fn data ( & self ) -> & ' d [ u8 ] {
930
+ pub fn data ( & self ) -> & ' data [ u8 ] {
931
931
self . data
932
932
}
933
933
}
@@ -946,29 +946,30 @@ impl fmt::Debug for BreakpadObject<'_> {
946
946
}
947
947
}
948
948
949
- impl < ' slf , ' d : ' slf > AsSelf < ' slf > for BreakpadObject < ' d > {
949
+ impl < ' slf , ' data : ' slf > AsSelf < ' slf > for BreakpadObject < ' data > {
950
950
type Ref = BreakpadObject < ' slf > ;
951
951
952
952
fn as_self ( & ' slf self ) -> & Self :: Ref {
953
953
self
954
954
}
955
955
}
956
956
957
- impl < ' d > Parse < ' d > for BreakpadObject < ' d > {
957
+ impl < ' data > Parse < ' data > for BreakpadObject < ' data > {
958
958
type Error = BreakpadError ;
959
959
960
960
fn test ( data : & [ u8 ] ) -> bool {
961
961
Self :: test ( data)
962
962
}
963
963
964
- fn parse ( data : & ' d [ u8 ] ) -> Result < Self , BreakpadError > {
964
+ fn parse ( data : & ' data [ u8 ] ) -> Result < Self , BreakpadError > {
965
965
Self :: parse ( data)
966
966
}
967
967
}
968
968
969
- impl < ' d > ObjectLike for BreakpadObject < ' d > {
969
+ impl < ' data : ' object , ' object > ObjectLike < ' data , ' object > for BreakpadObject < ' data > {
970
970
type Error = BreakpadError ;
971
- type Session = BreakpadDebugSession < ' d > ;
971
+ type Session = BreakpadDebugSession < ' data > ;
972
+ type SymbolIterator = BreakpadSymbolIterator < ' data > ;
972
973
973
974
fn file_format ( & self ) -> FileFormat {
974
975
self . file_format ( )
@@ -998,11 +999,11 @@ impl<'d> ObjectLike for BreakpadObject<'d> {
998
999
self . has_symbols ( )
999
1000
}
1000
1001
1001
- fn symbols ( & self ) -> DynIterator < ' _ , Symbol < ' _ > > {
1002
- Box :: new ( self . symbols ( ) )
1002
+ fn symbols ( & self ) -> Self :: SymbolIterator {
1003
+ self . symbols ( )
1003
1004
}
1004
1005
1005
- fn symbol_map ( & self ) -> SymbolMap < ' _ > {
1006
+ fn symbol_map ( & self ) -> SymbolMap < ' data > {
1006
1007
self . symbol_map ( )
1007
1008
}
1008
1009
@@ -1026,12 +1027,12 @@ impl<'d> ObjectLike for BreakpadObject<'d> {
1026
1027
/// An iterator over symbols in the Breakpad object.
1027
1028
///
1028
1029
/// Returned by [`BreakpadObject::symbols`](struct.BreakpadObject.html#method.symbols).
1029
- pub struct BreakpadSymbolIterator < ' d > {
1030
- records : BreakpadPublicRecords < ' d > ,
1030
+ pub struct BreakpadSymbolIterator < ' data > {
1031
+ records : BreakpadPublicRecords < ' data > ,
1031
1032
}
1032
1033
1033
- impl < ' d > Iterator for BreakpadSymbolIterator < ' d > {
1034
- type Item = Symbol < ' d > ;
1034
+ impl < ' data > Iterator for BreakpadSymbolIterator < ' data > {
1035
+ type Item = Symbol < ' data > ;
1035
1036
1036
1037
fn next ( & mut self ) -> Option < Self :: Item > {
1037
1038
while let Some ( result) = self . records . next ( ) {
0 commit comments