>);
60 |
61 | impl std::fmt::Debug for Transformers<'_> {
62 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
63 | let len = self.0.len();
64 | f.debug_tuple("Transformers").field(&len).finish()
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/symbolic-debuginfo/src/macho/mono_archive.rs:
--------------------------------------------------------------------------------
1 | use super::Parse;
2 | use std::{fmt, iter::FusedIterator, marker::PhantomData};
3 |
4 | pub(crate) struct MonoArchive<'d, P> {
5 | data: &'d [u8],
6 | _ph: PhantomData<&'d P>,
7 | }
8 |
9 | impl<'d, P> MonoArchive<'d, P>
10 | where
11 | P: Parse<'d>,
12 | {
13 | pub fn new(data: &'d [u8]) -> Self {
14 | MonoArchive {
15 | data,
16 | _ph: PhantomData,
17 | }
18 | }
19 |
20 | pub fn object(&self) -> Result {
21 | P::parse(self.data)
22 | }
23 |
24 | pub fn objects(&self) -> MonoArchiveObjects<'d, P> {
25 | // TODO(ja): Consider parsing this lazily instead.
26 | MonoArchiveObjects(Some(self.object()))
27 | }
28 |
29 | pub fn object_count(&self) -> usize {
30 | 1
31 | }
32 |
33 | pub fn object_by_index(&self, index: usize) -> Result