Skip to content

Commit 1a1ce79

Browse files
authored
Change Symbol fields to private (#349)
1 parent 6fd918a commit 1a1ce79

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

src/loader.rs

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,6 @@ pub struct Loader {
4444
arena_mmap: Arena<Mmap>,
4545
}
4646

47-
/// Information from a symbol table entry.
48-
pub struct Symbol<'a> {
49-
/// The symbol name
50-
pub name: &'a str,
51-
/// The symbol address
52-
pub address: u64,
53-
}
54-
5547
impl Loader {
5648
/// Load the DWARF data for an executable file and create a `Context`.
5749
#[inline]
@@ -487,3 +479,21 @@ fn convert_path(bytes: &[u8]) -> Result<PathBuf> {
487479
let s = std::str::from_utf8(bytes)?;
488480
Ok(PathBuf::from(s))
489481
}
482+
483+
/// Information from a symbol table entry.
484+
pub struct Symbol<'a> {
485+
name: &'a str,
486+
address: u64,
487+
}
488+
489+
impl<'a> Symbol<'a> {
490+
/// Get the symbol name.
491+
pub fn name(&self) -> &'a str {
492+
self.name
493+
}
494+
495+
/// Get the symbol address.
496+
pub fn address(&self) -> u64 {
497+
self.address
498+
}
499+
}

0 commit comments

Comments
 (0)