Skip to main content

FilesystemHost

Struct FilesystemHost 

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

A LinkHost backed by a directory on disk.

Host paths are relative to root; links can’t climb above it. Archives are opened read-only on demand, and cached by modification time, to look up entries. Nothing is extracted or written (Section 9.6).

Implementations§

Source§

impl FilesystemHost

Source

pub fn new(root: impl Into<PathBuf>) -> Self

A host rooted at root, with default options.

Source

pub fn with_options(root: impl Into<PathBuf>, options: HostOptions) -> Self

A host rooted at root.

Trait Implementations§

Source§

impl Debug for FilesystemHost

Source§

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

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

impl LinkHost for FilesystemHost

Source§

fn kind(&self, path: &str) -> Option<HostKind>

What exists at path, or None.
Source§

fn find_entry(&self, archive: &str, entry: &str) -> Option<String>

The stored entry path in archive matching entry (NFC, case-sensitive), or None.
Source§

fn entry_point(&self, archive: &str) -> Option<String>

The entry point of archive (Section 5.5), or None.
Whether links may leave an archive (Section 9.4).
Whether links may point into archives (Section 9.5).
Source§

fn trust_root(&self) -> Option<&str>

The trust boundary (Section 9.6): targets outside it are denied. Some("") trusts the whole host; None trusts no location at all.
Source§

fn is_allowed(&self, path: &str) -> bool

Host paths outside the boundary that the user explicitly allowed.
Source§

fn load_outside_resources(&self) -> bool

Whether embeds may load resources from outside an archive (inside the trust boundary only).
Source§

fn host_location(&self) -> bool

Whether the source archive has a location on this host (Section 9.4).

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.