Struct jrsonnet_parser::SourcePath
source · pub struct SourcePath(_);
Expand description
Represents location of a file
Standard CLI only operates using
SourceFile
- for any fileSourceDirectory
- for resolution from CWDSourceVirtual
- for stdlib/ext-str
From all of those, only SourceVirtual
may be constructed manually, any other path kind should be only obtained
from assigned ImportResolver
However, you should always check is_default
method return, as it will return true for any paths, where default
search location is applicable
Resolver may also return custom implementations of this trait, for example it may return http url in case of remotely loaded files
Implementations§
source§impl SourcePath
impl SourcePath
pub fn new(inner: impl SourcePathT) -> Self
pub fn downcast_ref<T: SourcePathT>(&self) -> Option<&T>
pub fn is_default(&self) -> bool
pub fn path(&self) -> Option<&Path>
Trait Implementations§
source§impl Clone for SourcePath
impl Clone for SourcePath
source§fn clone(&self) -> SourcePath
fn clone(&self) -> SourcePath
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SourcePath
impl Debug for SourcePath
source§impl Default for SourcePath
impl Default for SourcePath
source§impl Display for SourcePath
impl Display for SourcePath
source§impl Hash for SourcePath
impl Hash for SourcePath
source§impl PartialEq<SourcePath> for SourcePath
impl PartialEq<SourcePath> for SourcePath
source§impl Trace for SourcePath
impl Trace for SourcePath
impl Eq for SourcePath
impl StructuralEq for SourcePath
Auto Trait Implementations§
impl !RefUnwindSafe for SourcePath
impl !Send for SourcePath
impl !Sync for SourcePath
impl Unpin for SourcePath
impl !UnwindSafe for SourcePath
Blanket Implementations§
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more