pub struct ResourceId(/* private fields */);Expand description
A canonical absolute URI identifying a resource, serialized as a string. File URIs preserve non-UTF-8 Unix path bytes through percent encoding.
Implementations§
Source§impl ResourceId
impl ResourceId
Sourcepub fn from_path(path: impl AsRef<Path>) -> Result<Self>
pub fn from_path(path: impl AsRef<Path>) -> Result<Self>
Convert an absolute local path without accessing the filesystem.
URI dot segments are normalized. Request .paths(...) retains logical
root names for policy checks; discovery emits resolved resource IDs.
pub fn as_str(&self) -> &str
pub fn scheme(&self) -> &str
Sourcepub fn to_file_path(&self) -> Option<PathBuf>
pub fn to_file_path(&self) -> Option<PathBuf>
Return the local path for a file URI; other schemes have no local path.
Trait Implementations§
Source§impl Clone for ResourceId
impl Clone for ResourceId
Source§impl Debug for ResourceId
impl Debug for ResourceId
Source§impl<'de> Deserialize<'de> for ResourceId
impl<'de> Deserialize<'de> for ResourceId
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 Display for ResourceId
impl Display for ResourceId
impl Eq for ResourceId
Source§impl From<ResourceId> for String
impl From<ResourceId> for String
Source§fn from(value: ResourceId) -> Self
fn from(value: ResourceId) -> Self
Converts to this type from the input type.
Source§impl FromStr for ResourceId
impl FromStr for ResourceId
Source§impl Hash for ResourceId
impl Hash for ResourceId
Source§impl Ord for ResourceId
impl Ord for ResourceId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for ResourceId
impl PartialEq for ResourceId
Source§impl PartialOrd for ResourceId
impl PartialOrd for ResourceId
Source§impl Serialize for ResourceId
impl Serialize for ResourceId
impl StructuralPartialEq for ResourceId
Auto Trait Implementations§
impl Freeze for ResourceId
impl RefUnwindSafe for ResourceId
impl Send for ResourceId
impl Sync for ResourceId
impl Unpin for ResourceId
impl UnsafeUnpin for ResourceId
impl UnwindSafe for ResourceId
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.