pub enum IdRef {
Local(Id),
Foreign {
workspace: String,
id: Id,
},
Malformed,
}Expand description
What an id:-scheme target names.
The scheme carries three distinguishable things, and keeping them apart is
the whole point: a reference prov can resolve, one it deliberately cannot,
and one that is broken. See docs/reference-styles.md.
Variants§
Local(Id)
id:<id> — a document in this workspace, resolved through the registry.
Foreign
id:<workspace>/<id> — a document in the workspace named workspace.
prov resolves this only when workspace is the reading workspace’s own
workspace_id, in which case it
is local and is treated as such. Any other name is somewhere prov
cannot see: the library holds no map from a workspace name to a location
(that is a fact about a device, not about an archive), so the reference is
carried, never rewritten, and never reported broken.
Fields
Malformed
The id: scheme with a body that is no reference at all — an empty half
(id:, id:/x, id:ws/) or more than one separator (id:a/b/c).
Deliberately its own case rather than falling through to a path: the
author wrote id:, so silently resolving the text as a filename would
turn a typo into a dangling path and hide what actually went wrong.
Trait Implementations§
impl Eq for IdRef
impl StructuralPartialEq for IdRef
Auto Trait Implementations§
impl Freeze for IdRef
impl RefUnwindSafe for IdRef
impl Send for IdRef
impl Sync for IdRef
impl Unpin for IdRef
impl UnsafeUnpin for IdRef
impl UnwindSafe for IdRef
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.