Skip to main content

Resolved

Struct Resolved 

Source
pub struct Resolved {
    pub guest: Vec<u8>,
    pub host: Vec<u8>,
    pub at: At,
}
Expand description

A guest path resolved inside the guest namespace.

Fields§

§guest: Vec<u8>

The canonical absolute guest path.

§host: Vec<u8>

Its textual host path, for logging, identity checks and the /proc fakes; not what the syscall acts on when at is pinned.

§at: At

What the syscall acts on.

Implementations§

Source§

impl Resolved

Source

pub fn at(&self, nofollow: bool) -> Result<(RawFd, CString, bool), i32>

The (dirfd, path, nofollow) triple for a *at syscall.

§Arguments
  • nofollow - Whether the caller asked not to follow a final symlink.
§Returns

The descriptor and path to pass, and whether to pass the no-follow flag: always for a pinned name, never through a /proc/self/fd link (the object behind it is never a symlink), as asked otherwise.

Source

pub fn pinned(&self) -> bool

Whether the syscall acts through a pinned parent or object.

Source

pub fn is_mount_point(&self) -> bool

Whether the path names a mount point of the view itself.

Whether the path is a final /proc/<pid>/fd/N or map_files/X link left to the kernel.

Source

pub fn mode_nofollow(&self) -> Result<u32, i32>

st_mode of the object, without following a final symlink.

Source

pub fn object(&self, deref: bool) -> Result<(Arc<OwnedFd>, u32), i32>

An O_PATH descriptor of the object itself, for the syscalls without a dirfd form, which then act on /proc/self/fd/<n>.

§Arguments
  • deref - Whether the caller asked to follow a final symlink. The walk did so already, so a symlink found here was swapped in since and the lookup is retried; without deref a symlink is returned as the object, with its mode, for the caller to refuse or to act on through its parent.
§Returns

The descriptor and the object’s st_mode.

Source

pub fn parent_path(&self) -> Result<CString, i32>

The path of the object with only its parents pinned, /proc/self/fd/<parent>/<name>, for a syscall that must see the name as it is now (the l*xattr family, a socket address).

Trait Implementations§

Source§

impl Debug for Resolved

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 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.