pub enum PeerLocation {
Path(PathBuf),
Url(String),
}Expand description
An address a resolver answers with: somewhere on this device, or somewhere on the network.
Both spellings are first-class. A peer that is a sibling directory and a
peer that is a published site are the same kind of fact — “the host says it
is over there” — and a consumer that handles only one of them would work for
prov-cli and not for diaryx, or the reverse.
The same type answers for a workspace (PeerResolver::locate, where it is
the workspace root) and for one document inside it
(PeerResolver::locate_document, where it is the file). They are the same
two spellings and nothing distinguishes them but which question was asked.
Variants§
Path(PathBuf)
A path on the device doing the reading. Absolute by convention: a relative one would mean something different from each directory the host is later run in, which is the per-device failure this whole design is arranged around.
Url(String)
A URL. Never fetched here — prov does no network I/O — so this is carried and handed back exactly as the host spelled it.
Trait Implementations§
Source§impl Clone for PeerLocation
impl Clone for PeerLocation
Source§fn clone(&self) -> PeerLocation
fn clone(&self) -> PeerLocation
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 PeerLocation
impl Debug for PeerLocation
Source§impl Display for PeerLocation
impl Display for PeerLocation
impl Eq for PeerLocation
Source§impl PartialEq for PeerLocation
impl PartialEq for PeerLocation
impl StructuralPartialEq for PeerLocation
Auto Trait Implementations§
impl Freeze for PeerLocation
impl RefUnwindSafe for PeerLocation
impl Send for PeerLocation
impl Sync for PeerLocation
impl Unpin for PeerLocation
impl UnsafeUnpin for PeerLocation
impl UnwindSafe for PeerLocation
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.