Struct dynlink::library::Library

source ·
#[repr(C)]
pub struct Library { pub name: String, pub full_obj: Backing, pub backings: Vec<Backing>, pub tls_id: Option<TlsModId>, /* private fields */ }
Expand description

A loaded library. It may be in various relocation states.

Fields§

§name: String

Name of this library.

§full_obj: Backing

Object containing the full ELF data.

§backings: Vec<Backing>§tls_id: Option<TlsModId>

The module ID for the TLS region, if any.

Implementations§

source§

impl Library

source

pub fn id(&self) -> LibraryId

Get the ID for this library

source

pub fn compartment(&self) -> CompartmentId

Get the compartment ID for this library.

source

pub fn get_phdrs_raw(&self) -> Option<(*const Elf64_Phdr, usize)>

Get a raw pointer to the program headers for this library.

source

pub fn get_elf(&self) -> Result<ElfBytes<'_, NativeEndian>, ParseError>

Return a handle to the full ELF file.

source

pub fn base_addr(&self) -> usize

Get the load address for this library.

source

pub fn laddr<T>(&self, val: u64) -> *const T

Compute an in-memory address for a ELF virtual addr.

source

pub fn laddr_mut<T>(&self, val: u64) -> *mut T

Compute an in-memory address (mut) for a ELF virtual addr.

source

pub fn get_entry_address( &self ) -> Result<extern "C" fn(_: *const AuxEntry) -> !, DynlinkError>

Get a function pointer to this library’s entry address, if one exists.

source

pub fn iter_secgates(&self) -> Option<&[RawSecGateInfo]>

Trait Implementations§

source§

impl Debug for Library

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Library

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more