Struct LoaderOptions

Source
pub struct LoaderOptions { /* private fields */ }
Expand description

Dynamic loader options.

Implementations§

Source§

impl LoaderOptions

Source

pub fn new() -> Self

Default options.

Source

pub fn glibc<P: AsRef<Path>>(rootfs_dir: P) -> Result<Self, Error>

Glibc-specific options.

Source

pub fn musl<P: AsRef<Path>>(rootfs_dir: P, arch: &str) -> Result<Self, Error>

Musl-specific options.

Source

pub fn libc(self, libc: Libc) -> Self

Dynamic linker implementation that we’re emulating.

Affects library search order only.

To also set library search directories, use glibc and musl constructors.

Source

pub fn search_dirs(self, search_dirs: Vec<PathBuf>) -> Self

Directories where to look for libraries after searching in the RUNPATH or in the RPATH.

Use the following functions to initialize this field.

Source

pub fn search_dirs_override(self, search_dirs: Vec<PathBuf>) -> Self

Directories where to look for libraries before searching in the RUNPATH.

This list doesn’t affect RPATH-based lookup.

Use get_search_dirs_from_env to initialize this field.

Source

pub fn page_size(self, page_size: u64) -> Self

Set page size.

Panics if the size is not a power of two.

Source

pub fn lib(self, lib: Option<OsString>) -> Self

Set library directory name.

This value is used to substitute $LIB variable in RPATH and RUNPATH.

When not set lib is used for 32-bit arhitectures and lib64 is used for 64-bit architectures.

Source

pub fn platform(self, platform: Option<OsString>) -> Self

Set platform directory name.

This value is used to substitute $PLATFORM variable in RPATH and RUNPATH.

When not set the platform is interpolated based on Machine (best-effort).

Source

pub fn new_loader(self) -> DynamicLoader

Create new dynamic loader using the current options.

Trait Implementations§

Source§

impl Default for LoaderOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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.

Source§

impl<T, U> Into<U> for T
where 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.