pub enum RelativePath {
Cache(String),
Data(String),
Upload(VersionedPath),
}Expand description
Path relative to an app directory (upload, data, config, or cache).
Use this type in configuration when you need paths relative to app directories with optional version resolution for uploaded files.
For paths that are just strings (e.g., user-provided absolute paths or URLs), use String or
path types directly instead.
Variants§
Cache(String)
Path relative to the cache directory
Data(String)
Path relative to the data directory (non-versioned files)
Upload(VersionedPath)
Path to uploaded file with version resolution support (in uploads/ directory)
Implementations§
Source§impl RelativePath
impl RelativePath
Sourcepub fn get(&self, base: Option<&Dirs>) -> Result<PathBuf>
pub fn get(&self, base: Option<&Dirs>) -> Result<PathBuf>
Resolves the relative path to a full absolute PathBuf.
For Upload variant with VersionedPath, automatically resolves to the
latest UUID-versioned file in the uploads directory.
§Errors
Returns an error if:
- The path cannot be resolved
- For versioned paths, if the directory doesn’t exist or contains no files
- File system operations fail
Trait Implementations§
Source§impl Clone for RelativePath
impl Clone for RelativePath
Source§fn clone(&self) -> RelativePath
fn clone(&self) -> RelativePath
Returns a duplicate 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 ComposeSchema for RelativePath
impl ComposeSchema for RelativePath
Source§impl Debug for RelativePath
impl Debug for RelativePath
Source§impl<'de> Deserialize<'de> for RelativePath
impl<'de> Deserialize<'de> for RelativePath
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 Hash for RelativePath
impl Hash for RelativePath
Source§impl PartialEq for RelativePath
impl PartialEq for RelativePath
Source§impl Serialize for RelativePath
impl Serialize for RelativePath
Source§impl ToSchema for RelativePath
impl ToSchema for RelativePath
impl Eq for RelativePath
impl StructuralPartialEq for RelativePath
Auto Trait Implementations§
impl Freeze for RelativePath
impl RefUnwindSafe for RelativePath
impl Send for RelativePath
impl Sync for RelativePath
impl Unpin for RelativePath
impl UnwindSafe for RelativePath
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.