pub enum TargetKind {
Path,
Id,
Foreign {
workspace: String,
},
External,
SameDocument,
MalformedId,
}Expand description
What shape of thing a link’s target names, by syntax alone.
prov’s own Target is the resolved answer and needs a
workspace to produce; this is what can be known from the string, which is
what an editor drawing a row has. The two line up variant for variant, so a
frontend that starts with this and later gains a workspace does not restate
its rendering.
Variants§
Path
A path — relative to the document, or workspace-absolute with a leading
/. The ordinary case, and the only one resolvable without a registry.
Id
An id:<id> handle into this workspace’s registry.
Foreign
An id:<workspace>/<id> handle into another workspace. prov holds no
map from a workspace name to a location, so this names something without
locating it.
External
A URL or mail address — off-workspace, never resolved and never rewritten by a move.
SameDocument
A target that is only a #locator: a place inside the document the
link is written in, naming no other document.
MalformedId
The id: scheme with a body that is no reference at all (id:,
id:ws/, id:a/b/c).
Its own case rather than a path, on prov’s grounds: the author wrote
id:, so reading the rest as a filename would turn a typo into a
dangling path and hide what actually went wrong.
Trait Implementations§
Source§impl Clone for TargetKind
impl Clone for TargetKind
Source§fn clone(&self) -> TargetKind
fn clone(&self) -> TargetKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TargetKind
impl Debug for TargetKind
impl Eq for TargetKind
Source§impl PartialEq for TargetKind
impl PartialEq for TargetKind
impl StructuralPartialEq for TargetKind
Auto Trait Implementations§
impl Freeze for TargetKind
impl RefUnwindSafe for TargetKind
impl Send for TargetKind
impl Sync for TargetKind
impl Unpin for TargetKind
impl UnsafeUnpin for TargetKind
impl UnwindSafe for TargetKind
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> Equivalent<K> for Q
impl<Q, K> Equivalent<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.