pub struct TargetPath {
pub absolute: PathBuf,
pub relative: PathBuf,
pub project_root: PathBuf,
}Expand description
A validated target path for file generation
Fields§
§absolute: PathBufAbsolute path to the target directory
relative: PathBufRelative path from project root
project_root: PathBufProject root (for validation)
Implementations§
Source§impl TargetPath
impl TargetPath
Sourcepub fn resolve(
project_root: &Path,
custom_path: Option<&str>,
) -> Result<Self, PathError>
pub fn resolve( project_root: &Path, custom_path: Option<&str>, ) -> Result<Self, PathError>
Resolve and validate a target path
If custom_path is None, defaults to “src/ui/”.
If provided, validates that the path is:
- Relative (not absolute)
- Within the project bounds (no escaping via ..)
- Properly normalized (no redundant . or trailing slashes)
§Errors
Returns PathError if:
- Path is absolute
- Path escapes project directory
Trait Implementations§
Source§impl Clone for TargetPath
impl Clone for TargetPath
Source§fn clone(&self) -> TargetPath
fn clone(&self) -> TargetPath
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 Debug for TargetPath
impl Debug for TargetPath
Source§impl PartialEq for TargetPath
impl PartialEq for TargetPath
impl Eq for TargetPath
impl StructuralPartialEq for TargetPath
Auto Trait Implementations§
impl Freeze for TargetPath
impl RefUnwindSafe for TargetPath
impl Send for TargetPath
impl Sync for TargetPath
impl Unpin for TargetPath
impl UnwindSafe for TargetPath
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.