pub enum UserDefinedPath {
Managed(RelativePath),
External(String),
}Expand description
Path that can be either managed by the application or user-defined.
Use this type when a path could be either:
- An uploaded file managed by the app (with version resolution)
- A user-provided path on the filesystem
§Examples
ⓘ
// Managed: uploads/config.json (resolved to latest UUID)
UserDefinedPath::Managed(RelativePath::Data(VersionedPath::new("uploads/config.json")))
// External: /usr/local/bin/script.sh
UserDefinedPath::External("/usr/local/bin/script.sh".to_string())Variants§
Managed(RelativePath)
Application-managed path with optional version resolution
External(String)
User-provided external path (filesystem path or URL)
Implementations§
Source§impl UserDefinedPath
impl UserDefinedPath
Sourcepub fn resolve(&self, base: Option<&Dirs>) -> Result<PathBuf>
pub fn resolve(&self, base: Option<&Dirs>) -> Result<PathBuf>
Resolves the path to a full absolute PathBuf.
For Managed paths, uses RelativePath::get() with automatic version resolution.
For External paths, expands environment variables and tildes, then normalizes.
§Errors
Returns an error if:
- Path resolution fails
- For managed paths with versioning, if the directory doesn’t exist or contains no files
- Environment variable expansion fails
- File system operations fail
Trait Implementations§
Source§impl Clone for UserDefinedPath
impl Clone for UserDefinedPath
Source§fn clone(&self) -> UserDefinedPath
fn clone(&self) -> UserDefinedPath
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 UserDefinedPath
impl ComposeSchema for UserDefinedPath
Source§impl Debug for UserDefinedPath
impl Debug for UserDefinedPath
Source§impl<'de> Deserialize<'de> for UserDefinedPath
impl<'de> Deserialize<'de> for UserDefinedPath
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 UserDefinedPath
impl Hash for UserDefinedPath
Source§impl PartialEq for UserDefinedPath
impl PartialEq for UserDefinedPath
Source§impl Serialize for UserDefinedPath
impl Serialize for UserDefinedPath
Source§impl ToSchema for UserDefinedPath
impl ToSchema for UserDefinedPath
impl Eq for UserDefinedPath
impl StructuralPartialEq for UserDefinedPath
Auto Trait Implementations§
impl Freeze for UserDefinedPath
impl RefUnwindSafe for UserDefinedPath
impl Send for UserDefinedPath
impl Sync for UserDefinedPath
impl Unpin for UserDefinedPath
impl UnwindSafe for UserDefinedPath
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.