Skip to main content

Path

Struct Path 

Source
pub struct Path(/* private fields */);
Expand description

Borrowed ELF loader path.

Path is a small no_std path view used by file-backed inputs and linker resolvers. It intentionally models only the path operations needed by ELF loading and DT_NEEDED search, rather than the full std::path::Path API.

Implementations§

Source§

impl Path

Source

pub fn new(path: &str) -> &Self

Creates a borrowed loader path from a string slice.

Source

pub fn as_str(&self) -> &str

Returns this path as its underlying UTF-8 string.

Source

pub fn has_dir_separator(&self) -> bool

Returns whether the path contains / or \.

Source

pub fn parent(&self) -> &Self

Returns the parent directory used for $ORIGIN expansion.

Paths without a directory separator return "."; paths directly under the filesystem root return "/".

Source

pub fn file_name(&self) -> &str

Returns the last path component.

Source

pub fn join(&self, name: impl AsRef<str>) -> PathBuf

Joins a child path or filename to this directory.

Trait Implementations§

Source§

impl AsRef<Path> for Path

Source§

fn as_ref(&self) -> &Path

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<Path> for str

Source§

fn as_ref(&self) -> &Path

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<Path> for String

Source§

fn as_ref(&self) -> &Path

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<Path> for PathBuf

Source§

fn as_ref(&self) -> &Path

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<str> for Path

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Debug for Path

Source§

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

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

impl Display for Path

Source§

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

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

impl From<&Path> for PathBuf

Source§

fn from(path: &Path) -> Self

Converts to this type from the input type.
Source§

impl From<&Path> for ModuleKey

Source§

fn from(value: &Path) -> Self

Converts to this type from the input type.
Source§

impl<'a> IntoElfReader<'a> for &'a Path

Source§

type Reader = ElfFile

The type of reader produced by this conversion.
Source§

fn into_reader(self) -> Result<Self::Reader>

Converts the input into an ElfReader. Read more

Auto Trait Implementations§

§

impl !Sized for Path

§

impl Freeze for Path

§

impl RefUnwindSafe for Path

§

impl Send for Path

§

impl Sync for Path

§

impl Unpin for Path

§

impl UnsafeUnpin for Path

§

impl UnwindSafe for Path

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more