pub enum LinkScope {
Internal,
External,
}Expand description
Whether a link destination addresses something this repository holds, or somewhere outside it.
The distinction is one rule because it is asked in three places that each had
their own answer: the site renderer deciding whether a destination can be
rewritten to a page it serves, the rendered-site link gate deciding whose
uptime a href depends on, and — the reason this is pub rather than private
to either — a citation needing to know whether a locator names a work someone
else published.
§Deliberately closed, and not #[non_exhaustive]
The question is a yes/no one — a destination either names something this
repository is expected to contain or it does not — so this is a bool that
says which way round it is, and a bool cannot acquire a third value. Any
finer distinction anybody wants later (which scheme, which host, whether the
path exists) is a different question with a different answer type, not a
variant here; making it one would change what every existing arm means.
Variants§
Internal
A relative or root-relative path, or a bare #fragment: something this
repository is expected to contain.
External
A destination carrying a URL scheme (https:, mailto:, …) or written
protocol-relative (//host/…): somebody else’s.
Implementations§
Source§impl LinkScope
impl LinkScope
Sourcepub fn is_external(self) -> bool
pub fn is_external(self) -> bool
Whether this scope is LinkScope::External.
Trait Implementations§
impl Copy for LinkScope
impl Eq for LinkScope
Source§impl Ord for LinkScope
impl Ord for LinkScope
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for LinkScope
impl PartialOrd for LinkScope
impl StructuralPartialEq for LinkScope
Auto Trait Implementations§
impl Freeze for LinkScope
impl RefUnwindSafe for LinkScope
impl Send for LinkScope
impl Sync for LinkScope
impl Unpin for LinkScope
impl UnsafeUnpin for LinkScope
impl UnwindSafe for LinkScope
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.