pub struct ResourcePath(/* private fields */);Expand description
A path declared in user-facing settings.
Implementations§
Source§impl ResourcePath
impl ResourcePath
pub fn new(value: impl Into<String>) -> Self
The user-visible form of the path, suitable for round-trip serialization and for inclusion in error messages.
Sourcepub fn resolve(&self, workspace_root: &Path) -> Result<PathBuf, VarError>
pub fn resolve(&self, workspace_root: &Path) -> Result<PathBuf, VarError>
Expand this path to an absolute PathBuf.
Sourcepub fn promote_relative(&mut self, source_root: &Path)
pub fn promote_relative(&mut self, source_root: &Path)
Convert a bare relative path to an absolute one in place.
Trait Implementations§
Source§impl Clone for ResourcePath
impl Clone for ResourcePath
Source§fn clone(&self) -> ResourcePath
fn clone(&self) -> ResourcePath
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ResourcePath
impl Debug for ResourcePath
Source§impl Default for ResourcePath
impl Default for ResourcePath
Source§fn default() -> ResourcePath
fn default() -> ResourcePath
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ResourcePath
impl<'de> Deserialize<'de> for ResourcePath
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&str> for ResourcePath
impl From<&str> for ResourcePath
Source§impl From<String> for ResourcePath
impl From<String> for ResourcePath
Source§impl Hash for ResourcePath
impl Hash for ResourcePath
Source§impl JsonSchema for ResourcePath
impl JsonSchema for ResourcePath
Source§fn json_schema(_: &mut SchemaGenerator) -> Schema
fn json_schema(_: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for ResourcePath
impl PartialEq for ResourcePath
Source§fn eq(&self, other: &ResourcePath) -> bool
fn eq(&self, other: &ResourcePath) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ResourcePath
impl Serialize for ResourcePath
impl Eq for ResourcePath
impl StructuralPartialEq for ResourcePath
Auto Trait Implementations§
impl Freeze for ResourcePath
impl RefUnwindSafe for ResourcePath
impl Send for ResourcePath
impl Sync for ResourcePath
impl Unpin for ResourcePath
impl UnsafeUnpin for ResourcePath
impl UnwindSafe for ResourcePath
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
Mutably borrows from an owned value. Read more
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
Compare self to
key and return true if they are equal.