Skip to main content

Crate perl_uri

Crate perl_uri 

Source
Expand description

URI ↔ filesystem path conversion and normalization utilities.

This crate provides consistent URI handling for the Perl LSP ecosystem, including:

  • Converting between file:// URIs and filesystem paths
  • Windows drive-letter normalization
  • Percent encoding/decoding
  • Special scheme handling (untitled:, etc.)

§Platform Support

Most functions are not available on wasm32 targets since they require filesystem access.

§Examples

use perl_uri::{uri_to_fs_path, fs_path_to_uri};

// Convert a URI to a path
let path = uri_to_fs_path("file:///tmp/test.pl");
assert!(path.is_some());

// Convert a path to a URI
let uri = fs_path_to_uri("/tmp/test.pl");
assert!(uri.is_ok());

Re-exports§

pub use classify::is_file_uri;
pub use classify::is_special_scheme;
pub use classify::uri_extension;
pub use classify::uri_key;

Modules§

classify
URI classification and key normalization helpers (previously perl-uri-classify). URI classification and key normalization helpers.

Functions§

fs_path_to_uri
Convert a filesystem path to a file:// URI.
normalize_uri
Normalize a URI to a consistent form.
uri_to_fs_path
Convert a file:// URI to a filesystem path.