pub struct Policy {
pub schemes: BTreeSet<String>,
pub app_schemes: BTreeSet<String>,
pub trusted: BTreeSet<String>,
pub docs_hosts: BTreeSet<String>,
pub video_hosts: BTreeSet<String>,
pub docs_online: Option<String>,
}Expand description
The rules links follow: the schemes allowed, the hosts trusted for the session, the hosts holding the application’s documentation, the application’s own scheme.
Fields§
§schemes: BTreeSet<String>Schemes allowed; everything else is blocked.
app_schemes: BTreeSet<String>The application’s own schemes (helios), opened inside.
trusted: BTreeSet<String>Hosts trusted for this session: content links to them open without a confirmation (a host and its subdomains).
docs_hosts: BTreeSet<String>Hosts holding the application’s documentation: their markdown and HTML pages open inside when a viewer is there; content links to them are trusted.
video_hosts: BTreeSet<String>Hosts whose pages are videos.
docs_online: Option<String>Where the docs: pages are online (https://example.org/docs/):
without a viewer, docs:<page> opens <base><page> there.
Implementations§
Source§impl Policy
impl Policy
Sourcepub fn app_scheme(self, scheme: &str) -> Policy
pub fn app_scheme(self, scheme: &str) -> Policy
One of the application’s own schemes, opened inside (allowed too).
Sourcepub fn is_trusted(&self, host: &str) -> bool
pub fn is_trusted(&self, host: &str) -> bool
Whether content links to a host open without asking.
Sourcepub fn classify(
&self,
t: &Target,
facts: Option<&Facts>,
) -> Result<Kind, Reason>
pub fn classify( &self, t: &Target, facts: Option<&Facts>, ) -> Result<Kind, Reason>
What a target is, from its scheme, host and extension, and what is known of it on disk.