diff --git a/src/read/any.rs b/src/read/any.rs index 6ce20bc2..d6408ad4 100644 --- a/src/read/any.rs +++ b/src/read/any.rs @@ -307,16 +307,56 @@ impl<'data, R> Object<'data> for File<'data, R> where R: ReadRef<'data>, { - type Segment<'file> = Segment<'data, 'file, R> where Self: 'file, 'data: 'file; - type SegmentIterator<'file> = SegmentIterator<'data, 'file, R> where Self: 'file, 'data: 'file; - type Section<'file> = Section<'data, 'file, R> where Self: 'file, 'data: 'file; - type SectionIterator<'file> = SectionIterator<'data, 'file, R> where Self: 'file, 'data: 'file; - type Comdat<'file> = Comdat<'data, 'file, R> where Self: 'file, 'data: 'file; - type ComdatIterator<'file> = ComdatIterator<'data, 'file, R> where Self: 'file, 'data: 'file; - type Symbol<'file> = Symbol<'data, 'file, R> where Self: 'file, 'data: 'file; - type SymbolIterator<'file> = SymbolIterator<'data, 'file, R> where Self: 'file, 'data: 'file; - type SymbolTable<'file> = SymbolTable<'data, 'file, R> where Self: 'file, 'data: 'file; - type DynamicRelocationIterator<'file> = DynamicRelocationIterator<'data, 'file, R> where Self: 'file, 'data: 'file; + type Segment<'file> + = Segment<'data, 'file, R> + where + Self: 'file, + 'data: 'file; + type SegmentIterator<'file> + = SegmentIterator<'data, 'file, R> + where + Self: 'file, + 'data: 'file; + type Section<'file> + = Section<'data, 'file, R> + where + Self: 'file, + 'data: 'file; + type SectionIterator<'file> + = SectionIterator<'data, 'file, R> + where + Self: 'file, + 'data: 'file; + type Comdat<'file> + = Comdat<'data, 'file, R> + where + Self: 'file, + 'data: 'file; + type ComdatIterator<'file> + = ComdatIterator<'data, 'file, R> + where + Self: 'file, + 'data: 'file; + type Symbol<'file> + = Symbol<'data, 'file, R> + where + Self: 'file, + 'data: 'file; + type SymbolIterator<'file> + = SymbolIterator<'data, 'file, R> + where + Self: 'file, + 'data: 'file; + type SymbolTable<'file> + = SymbolTable<'data, 'file, R> + where + Self: 'file, + 'data: 'file; + type DynamicRelocationIterator<'file> + = DynamicRelocationIterator<'data, 'file, R> + where + Self: 'file, + 'data: 'file; fn architecture(&self) -> Architecture { with_inner!(self, File, |x| x.architecture()) diff --git a/src/read/coff/file.rs b/src/read/coff/file.rs index 525c11d3..7a1681a7 100644 --- a/src/read/coff/file.rs +++ b/src/read/coff/file.rs @@ -90,16 +90,56 @@ where R: ReadRef<'data>, Coff: CoffHeader, { - type Segment<'file> = CoffSegment<'data, 'file, R, Coff> where Self: 'file, 'data: 'file; - type SegmentIterator<'file> = CoffSegmentIterator<'data, 'file, R, Coff> where Self: 'file, 'data: 'file; - type Section<'file> = CoffSection<'data, 'file, R, Coff> where Self: 'file, 'data: 'file; - type SectionIterator<'file> = CoffSectionIterator<'data, 'file, R, Coff> where Self: 'file, 'data: 'file; - type Comdat<'file> = CoffComdat<'data, 'file, R, Coff> where Self: 'file, 'data: 'file; - type ComdatIterator<'file> = CoffComdatIterator<'data, 'file, R, Coff> where Self: 'file, 'data: 'file; - type Symbol<'file> = CoffSymbol<'data, 'file, R, Coff> where Self: 'file, 'data: 'file; - type SymbolIterator<'file> = CoffSymbolIterator<'data, 'file, R, Coff> where Self: 'file, 'data: 'file; - type SymbolTable<'file> = CoffSymbolTable<'data, 'file, R, Coff> where Self: 'file, 'data: 'file; - type DynamicRelocationIterator<'file> = NoDynamicRelocationIterator where Self: 'file, 'data: 'file; + type Segment<'file> + = CoffSegment<'data, 'file, R, Coff> + where + Self: 'file, + 'data: 'file; + type SegmentIterator<'file> + = CoffSegmentIterator<'data, 'file, R, Coff> + where + Self: 'file, + 'data: 'file; + type Section<'file> + = CoffSection<'data, 'file, R, Coff> + where + Self: 'file, + 'data: 'file; + type SectionIterator<'file> + = CoffSectionIterator<'data, 'file, R, Coff> + where + Self: 'file, + 'data: 'file; + type Comdat<'file> + = CoffComdat<'data, 'file, R, Coff> + where + Self: 'file, + 'data: 'file; + type ComdatIterator<'file> + = CoffComdatIterator<'data, 'file, R, Coff> + where + Self: 'file, + 'data: 'file; + type Symbol<'file> + = CoffSymbol<'data, 'file, R, Coff> + where + Self: 'file, + 'data: 'file; + type SymbolIterator<'file> + = CoffSymbolIterator<'data, 'file, R, Coff> + where + Self: 'file, + 'data: 'file; + type SymbolTable<'file> + = CoffSymbolTable<'data, 'file, R, Coff> + where + Self: 'file, + 'data: 'file; + type DynamicRelocationIterator<'file> + = NoDynamicRelocationIterator + where + Self: 'file, + 'data: 'file; fn architecture(&self) -> Architecture { match self.header.machine() { diff --git a/src/read/elf/file.rs b/src/read/elf/file.rs index bc2afc7d..8b91ecb6 100644 --- a/src/read/elf/file.rs +++ b/src/read/elf/file.rs @@ -187,16 +187,56 @@ where Elf: FileHeader, R: ReadRef<'data>, { - type Segment<'file> = ElfSegment<'data, 'file, Elf, R> where Self: 'file, 'data: 'file; - type SegmentIterator<'file> = ElfSegmentIterator<'data, 'file, Elf, R> where Self: 'file, 'data: 'file; - type Section<'file> = ElfSection<'data, 'file, Elf, R> where Self: 'file, 'data: 'file; - type SectionIterator<'file> = ElfSectionIterator<'data, 'file, Elf, R> where Self: 'file, 'data: 'file; - type Comdat<'file> = ElfComdat<'data, 'file, Elf, R> where Self: 'file, 'data: 'file; - type ComdatIterator<'file> = ElfComdatIterator<'data, 'file, Elf, R> where Self: 'file, 'data: 'file; - type Symbol<'file> = ElfSymbol<'data, 'file, Elf, R> where Self: 'file, 'data: 'file; - type SymbolIterator<'file> = ElfSymbolIterator<'data, 'file, Elf, R> where Self: 'file, 'data: 'file; - type SymbolTable<'file> = ElfSymbolTable<'data, 'file, Elf, R> where Self: 'file, 'data: 'file; - type DynamicRelocationIterator<'file> = ElfDynamicRelocationIterator<'data, 'file, Elf, R> where Self: 'file, 'data: 'file; + type Segment<'file> + = ElfSegment<'data, 'file, Elf, R> + where + Self: 'file, + 'data: 'file; + type SegmentIterator<'file> + = ElfSegmentIterator<'data, 'file, Elf, R> + where + Self: 'file, + 'data: 'file; + type Section<'file> + = ElfSection<'data, 'file, Elf, R> + where + Self: 'file, + 'data: 'file; + type SectionIterator<'file> + = ElfSectionIterator<'data, 'file, Elf, R> + where + Self: 'file, + 'data: 'file; + type Comdat<'file> + = ElfComdat<'data, 'file, Elf, R> + where + Self: 'file, + 'data: 'file; + type ComdatIterator<'file> + = ElfComdatIterator<'data, 'file, Elf, R> + where + Self: 'file, + 'data: 'file; + type Symbol<'file> + = ElfSymbol<'data, 'file, Elf, R> + where + Self: 'file, + 'data: 'file; + type SymbolIterator<'file> + = ElfSymbolIterator<'data, 'file, Elf, R> + where + Self: 'file, + 'data: 'file; + type SymbolTable<'file> + = ElfSymbolTable<'data, 'file, Elf, R> + where + Self: 'file, + 'data: 'file; + type DynamicRelocationIterator<'file> + = ElfDynamicRelocationIterator<'data, 'file, Elf, R> + where + Self: 'file, + 'data: 'file; fn architecture(&self) -> Architecture { match ( diff --git a/src/read/macho/file.rs b/src/read/macho/file.rs index d3721cd1..074acaac 100644 --- a/src/read/macho/file.rs +++ b/src/read/macho/file.rs @@ -221,16 +221,56 @@ where Mach: MachHeader, R: ReadRef<'data>, { - type Segment<'file> = MachOSegment<'data, 'file, Mach, R> where Self: 'file, 'data: 'file; - type SegmentIterator<'file> = MachOSegmentIterator<'data, 'file, Mach, R> where Self: 'file, 'data: 'file; - type Section<'file> = MachOSection<'data, 'file, Mach, R> where Self: 'file, 'data: 'file; - type SectionIterator<'file> = MachOSectionIterator<'data, 'file, Mach, R> where Self: 'file, 'data: 'file; - type Comdat<'file> = MachOComdat<'data, 'file, Mach, R> where Self: 'file, 'data: 'file; - type ComdatIterator<'file> = MachOComdatIterator<'data, 'file, Mach, R> where Self: 'file, 'data: 'file; - type Symbol<'file> = MachOSymbol<'data, 'file, Mach, R> where Self: 'file, 'data: 'file; - type SymbolIterator<'file> = MachOSymbolIterator<'data, 'file, Mach, R> where Self: 'file, 'data: 'file; - type SymbolTable<'file> = MachOSymbolTable<'data, 'file, Mach, R> where Self: 'file, 'data: 'file; - type DynamicRelocationIterator<'file> = NoDynamicRelocationIterator where Self: 'file, 'data: 'file; + type Segment<'file> + = MachOSegment<'data, 'file, Mach, R> + where + Self: 'file, + 'data: 'file; + type SegmentIterator<'file> + = MachOSegmentIterator<'data, 'file, Mach, R> + where + Self: 'file, + 'data: 'file; + type Section<'file> + = MachOSection<'data, 'file, Mach, R> + where + Self: 'file, + 'data: 'file; + type SectionIterator<'file> + = MachOSectionIterator<'data, 'file, Mach, R> + where + Self: 'file, + 'data: 'file; + type Comdat<'file> + = MachOComdat<'data, 'file, Mach, R> + where + Self: 'file, + 'data: 'file; + type ComdatIterator<'file> + = MachOComdatIterator<'data, 'file, Mach, R> + where + Self: 'file, + 'data: 'file; + type Symbol<'file> + = MachOSymbol<'data, 'file, Mach, R> + where + Self: 'file, + 'data: 'file; + type SymbolIterator<'file> + = MachOSymbolIterator<'data, 'file, Mach, R> + where + Self: 'file, + 'data: 'file; + type SymbolTable<'file> + = MachOSymbolTable<'data, 'file, Mach, R> + where + Self: 'file, + 'data: 'file; + type DynamicRelocationIterator<'file> + = NoDynamicRelocationIterator + where + Self: 'file, + 'data: 'file; fn architecture(&self) -> Architecture { match self.header.cputype(self.endian) { diff --git a/src/read/pe/file.rs b/src/read/pe/file.rs index ec9d9e6c..d0ab409f 100644 --- a/src/read/pe/file.rs +++ b/src/read/pe/file.rs @@ -143,16 +143,56 @@ where Pe: ImageNtHeaders, R: ReadRef<'data>, { - type Segment<'file> = PeSegment<'data, 'file, Pe, R> where Self: 'file, 'data: 'file; - type SegmentIterator<'file> = PeSegmentIterator<'data, 'file, Pe, R> where Self: 'file, 'data: 'file; - type Section<'file> = PeSection<'data, 'file, Pe, R> where Self: 'file, 'data: 'file; - type SectionIterator<'file> = PeSectionIterator<'data, 'file, Pe, R> where Self: 'file, 'data: 'file; - type Comdat<'file> = PeComdat<'data, 'file, Pe, R> where Self: 'file, 'data: 'file; - type ComdatIterator<'file> = PeComdatIterator<'data, 'file, Pe, R> where Self: 'file, 'data: 'file; - type Symbol<'file> = CoffSymbol<'data, 'file, R> where Self: 'file, 'data: 'file; - type SymbolIterator<'file> = CoffSymbolIterator<'data, 'file, R> where Self: 'file, 'data: 'file; - type SymbolTable<'file> = CoffSymbolTable<'data, 'file, R> where Self: 'file, 'data: 'file; - type DynamicRelocationIterator<'file> = NoDynamicRelocationIterator where Self: 'file, 'data: 'file; + type Segment<'file> + = PeSegment<'data, 'file, Pe, R> + where + Self: 'file, + 'data: 'file; + type SegmentIterator<'file> + = PeSegmentIterator<'data, 'file, Pe, R> + where + Self: 'file, + 'data: 'file; + type Section<'file> + = PeSection<'data, 'file, Pe, R> + where + Self: 'file, + 'data: 'file; + type SectionIterator<'file> + = PeSectionIterator<'data, 'file, Pe, R> + where + Self: 'file, + 'data: 'file; + type Comdat<'file> + = PeComdat<'data, 'file, Pe, R> + where + Self: 'file, + 'data: 'file; + type ComdatIterator<'file> + = PeComdatIterator<'data, 'file, Pe, R> + where + Self: 'file, + 'data: 'file; + type Symbol<'file> + = CoffSymbol<'data, 'file, R> + where + Self: 'file, + 'data: 'file; + type SymbolIterator<'file> + = CoffSymbolIterator<'data, 'file, R> + where + Self: 'file, + 'data: 'file; + type SymbolTable<'file> + = CoffSymbolTable<'data, 'file, R> + where + Self: 'file, + 'data: 'file; + type DynamicRelocationIterator<'file> + = NoDynamicRelocationIterator + where + Self: 'file, + 'data: 'file; fn architecture(&self) -> Architecture { match self.nt_headers.file_header().machine.get(LE) { diff --git a/src/read/wasm.rs b/src/read/wasm.rs index 9a174be2..19303cd0 100644 --- a/src/read/wasm.rs +++ b/src/read/wasm.rs @@ -372,16 +372,56 @@ impl<'data, R: ReadRef<'data>> WasmFile<'data, R> { impl<'data, R> read::private::Sealed for WasmFile<'data, R> {} impl<'data, R: ReadRef<'data>> Object<'data> for WasmFile<'data, R> { - type Segment<'file> = WasmSegment<'data, 'file, R> where Self: 'file, 'data: 'file; - type SegmentIterator<'file> = WasmSegmentIterator<'data, 'file, R> where Self: 'file, 'data: 'file; - type Section<'file> = WasmSection<'data, 'file, R> where Self: 'file, 'data: 'file; - type SectionIterator<'file> = WasmSectionIterator<'data, 'file, R> where Self: 'file, 'data: 'file; - type Comdat<'file> = WasmComdat<'data, 'file, R> where Self: 'file, 'data: 'file; - type ComdatIterator<'file> = WasmComdatIterator<'data, 'file, R> where Self: 'file, 'data: 'file; - type Symbol<'file> = WasmSymbol<'data, 'file> where Self: 'file, 'data: 'file; - type SymbolIterator<'file> = WasmSymbolIterator<'data, 'file> where Self: 'file, 'data: 'file; - type SymbolTable<'file> = WasmSymbolTable<'data, 'file> where Self: 'file, 'data: 'file; - type DynamicRelocationIterator<'file> = NoDynamicRelocationIterator where Self: 'file, 'data: 'file; + type Segment<'file> + = WasmSegment<'data, 'file, R> + where + Self: 'file, + 'data: 'file; + type SegmentIterator<'file> + = WasmSegmentIterator<'data, 'file, R> + where + Self: 'file, + 'data: 'file; + type Section<'file> + = WasmSection<'data, 'file, R> + where + Self: 'file, + 'data: 'file; + type SectionIterator<'file> + = WasmSectionIterator<'data, 'file, R> + where + Self: 'file, + 'data: 'file; + type Comdat<'file> + = WasmComdat<'data, 'file, R> + where + Self: 'file, + 'data: 'file; + type ComdatIterator<'file> + = WasmComdatIterator<'data, 'file, R> + where + Self: 'file, + 'data: 'file; + type Symbol<'file> + = WasmSymbol<'data, 'file> + where + Self: 'file, + 'data: 'file; + type SymbolIterator<'file> + = WasmSymbolIterator<'data, 'file> + where + Self: 'file, + 'data: 'file; + type SymbolTable<'file> + = WasmSymbolTable<'data, 'file> + where + Self: 'file, + 'data: 'file; + type DynamicRelocationIterator<'file> + = NoDynamicRelocationIterator + where + Self: 'file, + 'data: 'file; #[inline] fn architecture(&self) -> Architecture { diff --git a/src/read/xcoff/file.rs b/src/read/xcoff/file.rs index 6d8de8dd..a30aee65 100644 --- a/src/read/xcoff/file.rs +++ b/src/read/xcoff/file.rs @@ -110,16 +110,56 @@ where Xcoff: FileHeader, R: ReadRef<'data>, { - type Segment<'file> = XcoffSegment<'data, 'file, Xcoff, R> where Self: 'file, 'data: 'file; - type SegmentIterator<'file> = XcoffSegmentIterator<'data, 'file, Xcoff, R> where Self: 'file, 'data: 'file; - type Section<'file> = XcoffSection<'data, 'file, Xcoff, R> where Self: 'file, 'data: 'file; - type SectionIterator<'file> = XcoffSectionIterator<'data, 'file, Xcoff, R> where Self: 'file, 'data: 'file; - type Comdat<'file> = XcoffComdat<'data, 'file, Xcoff, R> where Self: 'file, 'data: 'file; - type ComdatIterator<'file> = XcoffComdatIterator<'data, 'file, Xcoff, R> where Self: 'file, 'data: 'file; - type Symbol<'file> = XcoffSymbol<'data, 'file, Xcoff, R> where Self: 'file, 'data: 'file; - type SymbolIterator<'file> = XcoffSymbolIterator<'data, 'file, Xcoff, R> where Self: 'file, 'data: 'file; - type SymbolTable<'file> = XcoffSymbolTable<'data, 'file, Xcoff, R> where Self: 'file, 'data: 'file; - type DynamicRelocationIterator<'file> = NoDynamicRelocationIterator where Self: 'file, 'data: 'file; + type Segment<'file> + = XcoffSegment<'data, 'file, Xcoff, R> + where + Self: 'file, + 'data: 'file; + type SegmentIterator<'file> + = XcoffSegmentIterator<'data, 'file, Xcoff, R> + where + Self: 'file, + 'data: 'file; + type Section<'file> + = XcoffSection<'data, 'file, Xcoff, R> + where + Self: 'file, + 'data: 'file; + type SectionIterator<'file> + = XcoffSectionIterator<'data, 'file, Xcoff, R> + where + Self: 'file, + 'data: 'file; + type Comdat<'file> + = XcoffComdat<'data, 'file, Xcoff, R> + where + Self: 'file, + 'data: 'file; + type ComdatIterator<'file> + = XcoffComdatIterator<'data, 'file, Xcoff, R> + where + Self: 'file, + 'data: 'file; + type Symbol<'file> + = XcoffSymbol<'data, 'file, Xcoff, R> + where + Self: 'file, + 'data: 'file; + type SymbolIterator<'file> + = XcoffSymbolIterator<'data, 'file, Xcoff, R> + where + Self: 'file, + 'data: 'file; + type SymbolTable<'file> + = XcoffSymbolTable<'data, 'file, Xcoff, R> + where + Self: 'file, + 'data: 'file; + type DynamicRelocationIterator<'file> + = NoDynamicRelocationIterator + where + Self: 'file, + 'data: 'file; fn architecture(&self) -> Architecture { if self.is_64() {