pub trait LinkHost {
// Required methods
fn kind(&self, path: &str) -> Option<HostKind>;
fn find_entry(&self, archive: &str, entry: &str) -> Option<String>;
fn entry_point(&self, archive: &str) -> Option<String>;
// Provided methods
fn host_location(&self) -> bool { ... }
fn outside_links(&self) -> bool { ... }
fn links_into_archives(&self) -> bool { ... }
fn trust_root(&self) -> Option<&str> { ... }
fn is_allowed(&self, _path: &str) -> bool { ... }
fn load_outside_resources(&self) -> bool { ... }
}Expand description
What link resolution needs to know about the files around an archive.
Host paths are /-separated and relative to the host’s root. The
capability and trust methods have defaults matching the spec: links may
leave archives and go into them, the whole host is trusted, and embeds
never load resources from outside an archive.
Required Methods§
Sourcefn find_entry(&self, archive: &str, entry: &str) -> Option<String>
fn find_entry(&self, archive: &str, entry: &str) -> Option<String>
The stored entry path in archive matching entry (NFC,
case-sensitive), or None.
Sourcefn entry_point(&self, archive: &str) -> Option<String>
fn entry_point(&self, archive: &str) -> Option<String>
The entry point of archive (Section 5.5), or None.
Provided Methods§
Sourcefn host_location(&self) -> bool
fn host_location(&self) -> bool
Whether the source archive has a location on this host (Section 9.4).
Sourcefn outside_links(&self) -> bool
fn outside_links(&self) -> bool
Whether links may leave an archive (Section 9.4).
Sourcefn links_into_archives(&self) -> bool
fn links_into_archives(&self) -> bool
Whether links may point into archives (Section 9.5).
Sourcefn trust_root(&self) -> Option<&str>
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.
Sourcefn is_allowed(&self, _path: &str) -> bool
fn is_allowed(&self, _path: &str) -> bool
Host paths outside the boundary that the user explicitly allowed.
Sourcefn load_outside_resources(&self) -> bool
fn load_outside_resources(&self) -> bool
Whether embeds may load resources from outside an archive (inside the trust boundary only).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".