Skip to main content

validate_output_path

Function validate_output_path 

Source
pub fn validate_output_path(path: &str, kind: &str) -> Result<PathBuf, McpError>
Expand description

Validate a user-supplied output path that may not yet exist.

Must be absolute. If the file exists, behaves like validate_input_path. Otherwise the parent directory must exist and canonicalize cleanly.

§Errors

Same shape as validate_input_path; additionally returns ErrorCode::InvalidArgument if the path has no parent or no file-name.