typed-path
Provides typed variants of Path and PathBuf for Unix and Windows
0.12.3
28M downloads/mo
#1761 most downloaded on crates.io
chipsenkbeil/typed-path
What this package is like to depend on
Last release 6 months ago
11 Feb 2026
Ships fairly regularly
a new release about every 2 months
Nearly every release is documented
notes for 24 of 24 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
24 releases · first in 2022
4 releases in the last 12 months
see the full history below
Release timeline
24 releases · Aug 2022 to Feb 2026Releases
latest 24-
0.12.311 Feb 2026Release notes
Open source →What's Changed
- Remove AsRef<Path> for Cow<[u8]> and AsRef<Utf8Path> for Cow as they conflict with other libraries by @Its-Just-Nans in 7dc7403
New Contributors
- @Its-Just-Nans made their first contribution in 7dc7403
Full Changelog: v0.12.2...v0.12.3
Release notes
Open source →- Remove AsRef<Path<T>> for Cow<[u8]> and AsRef<Utf8Path<T>> for Cow<str> as they conflict with other libraries (by Its-Just-Nans)
-
0.12.228 Jan 2026 -
0.12.122 Jan 2026Release notes
Open source →What's Changed
- fix: enable wasip2 feature for wasm32-wasip2 target by @cdmurph32 in #57
New Contributors
- @cdmurph32 made their first contribution in #57
Full Changelog: v0.12.0...v0.12.1
Release notes
Open source →- Enable wasip2 feature for wasm32-wasip2 target (#57)
- Fix unused import warning for
std::ioon wasm targets where theabsolutizefunction (which usesio) is not available (#57)
-
0.12.005 Oct 2025Release notes
Open source →What's Changed
- Fix type reference for parent() methods mentioned in #44
- Refactor utils to return platform paths instead of native paths
- Expose native and platform modules only when unix or windows by @AlexCharlton in #51
- Fix for platforms not supporting atomic loads by @Oakchris1955 in #52
- Update to be compliant with Rust Clippy 1.90.0
New Contributors
- @AlexCharlton made their first contribution in #51
- @Oakchris1955 made their first contribution in #52
Full Changelog: v0.11.0...v0.12.0
Release notes
Open source →- Fix type reference for parent() methods mentioned in #44
- Refactor utils to return platform paths instead of native paths
- Expose native and platform mods only when unix or windows (#51)
- Fix for platforms not supporting atomic loads (#52)
- Update to be compliant with Rust Clippy 1.90.0
-
0.11.025 Apr 2025Release notes
Open source →What's Changed
- Lift static restriction for Path methods by @fominok in #46
- Switch to dtolnay/rust-toolchain by @chipsenkbeil in #48
- Remove lifetime from
EncodingandUtf8Encodingtraits by @fominok in #47
As a consequence of #47, this bumps the minimum Rust version to
1.65.0.New Contributors
Full Changelog: v0.10.0...v0.11.0
Release notes
Open source →- Lift restriction on static lifetime for checking if an encoding is representative of the platform (#46)
- Remove lifetime from
EncodingandUtf8Encodingtraits as GATs introduced in Rust1.65.0enable us to relax this requirement (#47) - Switch to
dtolnay/rust-toolchainto fix issues where minimum version of Rust wasn't being applied in tests (#48)
-
0.10.001 Dec 2024Release notes
Open source →What's Changed
- Add
PlatformEncodingandUtf8PlatformEncodingstructs that mirror the
functionality ofNativeEncodingandUtf8NativeEncodingrespectively, but
as distinct structs instead of type aliases. - Add
PlatformPathandPlatformPathBuftype aliases that usePlatformEncoding. - Add
Utf8PlatformPathandUtf8PlatformPathBuftype aliases that useUtf8PlatformEncoding. - Add
AsRef<ffi::OsStr>forUtf8PathandUtf8PathBuf. - Add
TryAsRef<Utf8Path>forffi::OsStrandffi::OsString. - Add
From<Utf8PathBuf>forffi::OsString. - Remove implementation of
TryAsRef<std::path::Path>forPath<T>. - Remove implementation of
TryAsRef<Path<T>>forstd::path::Path. - Remove implementation of
TryAsRef<std::path::Path>forTypedPath. - Remove implementation of
TryAsRef<std::path::Path>forUtf8TypedPath. - Remove implementation of
TryFrom<Utf8TypedPathBuf>forstd::path::PathBuf. - Remove implementation of
TryFrom<Utf8TypedPathBuf>forstd::path::PathBuf. - Remove implementation of
From<Utf8UnixPathBuf>forstd::path::PathBuf. - Remove implementation of
From<Utf8WindowsPathBuf>forstd::path::PathBuf.
Full Changelog: v0.9.3...v0.10.0
Release notes
Open source →- Add
PlatformEncodingandUtf8PlatformEncodingstructs that mirror the functionality ofNativeEncodingandUtf8NativeEncodingrespectively, but as distinct structs instead of type aliases. - Add
PlatformPathandPlatformPathBuftype aliases that usePlatformEncoding. - Add
Utf8PlatformPathandUtf8PlatformPathBuftype aliases that useUtf8PlatformEncoding. - Add
AsRef<ffi::OsStr>forUtf8PathandUtf8PathBuf. - Add
TryAsRef<Utf8Path>forffi::OsStrandffi::OsString. - Add
From<Utf8PathBuf>forffi::OsString. - Remove implementation of
TryAsRef<std::path::Path>forPath<T>. - Remove implementation of
TryAsRef<Path<T>>forstd::path::Path. - Remove implementation of
TryAsRef<std::path::Path>forTypedPath. - Remove implementation of
TryAsRef<std::path::Path>forUtf8TypedPath. - Remove implementation of
TryFrom<Utf8TypedPathBuf>forstd::path::PathBuf. - Remove implementation of
TryFrom<Utf8TypedPathBuf>forstd::path::PathBuf. - Remove implementation of
From<Utf8UnixPathBuf>forstd::path::PathBuf. - Remove implementation of
From<Utf8WindowsPathBuf>forstd::path::PathBuf.
- Add
-
0.9.315 Oct 2024Release notes
Open source →What's Changed
- Change lib.rs permissions to remove execution by @danielmellado in #33
New Contributors
- @danielmellado made their first contribution in #33
Full Changelog: v0.9.2...v0.9.3
-
0.9.215 Sep 2024Release notes
Open source →What's Changed
- Fix
TypedPathBuf::windows()andUtf8TypedPathBuf::windows()to properly return an instance ofWindowsPathBufandUtf8WindowsPathBufrespectively. Before this fix, the function instead returned a Unix path wrapper. (by @vnghia in #30) - Address clippy warnings and update some metadata by @chipsenkbeil in #31
- Minimum Rust version of 1.58.1 is now specified via
rust-versionin Cargo.toml
New Contributors
Full Changelog: v0.9.1...v0.9.2
Release notes
Open source →- Fix
windows()function ofTypedPathBufandUtf8TypedPathBufto properly return an instance ofWindowsPathBufandUtf8WindowsPathBufrespectively. Before this fix, the function instead returned a Unix path wrapper. (#30) - Minimum Rust version of 1.58.1 is now explicitly set via
rust-version. - Address a variety of internal clippy warnings.
- Fix
-
0.9.116 Jul 2024Release notes
Open source →What's Changed
- add back missing derives by @stevefan1999-personal in #27
New Contributors
- @stevefan1999-personal made their first contribution in #27
Full Changelog: v0.9.0...v0.9.1
Release notes
Open source →- Add derived
Hash,PartialOrd, andOrdimplementations forTypedPathandTypedPathBufenumerations.
-
0.9.015 Jun 2024Release notes
Open source →What's Changed
- Add typed-path versions for
current_exeandtemp_dir, including UTF8 variants by @simongoricar in #24
New Contributors
- @simongoricar made their first contribution in #24
Full Changelog: v0.8.0...v0.9.0
Release notes
Open source →- Add
current_exeandutf8_current_exefunctions to theutilsmodule to return native pathbufs wrapping the standard library paths. - Add
temp_dirandutf8_temp_dirfunctions to theutilsmodule to return native pathbufs wrapping the standard library paths.
- Add typed-path versions for
-
0.8.025 Feb 2024Release notes
Open source →- Add
push_checkedfunction, which ensures that any path added to an existingPathBuforTypedPathBufmust abide by the following rules:- It cannot be an absolute path. Only relative paths allowed.
- In the case of Windows, it cannot start with a prefix like
C:. - All normal components of the path must contain only valid characters.
- If parent directory (..) components are present, they must not result in a path traversal attack (impacting the current path).
- Add
join_checkedfunction, which ensures that any path joied with an existing path follows the rules ofpush_checked - Add
with_encoding_checkedfunction to ensure that the resulting path from an encoding conversion is still valid - Add
with_unix_encoding_checkedandwith_windows_encoding_checkedfunctions as shortcuts towith_encoding_checked - Add
is_validtoComponentandUtf8Componenttraits alongsidePathandUtf8Pathto indicate if a component/path is valid for the given encoding
- Add
-
0.7.116 Feb 2024 -
0.7.004 Nov 2023Release notes
Open source →- Support
no_stdenvironments, whendefault-features = falseis set for the crate
- Support
-
0.6.013 Oct 2023Release notes
Open source →- Refactor crate exports such that everything other than constants are now
top-level exports
typed_path::unix::UnixComponentis nowtyped_path::UnixComponenttyped_path::unix::Utf8UnixComponentis nowtyped_path::Utf8UnixComponenttyped_path::windows::WindowsComponentis nowtyped_path::WindowsComponenttyped_path::windows::Utf8WindowsComponentis nowtyped_path::Utf8WindowsComponenttyped_path::windows::WindowsPrefixis nowtyped_path::WindowsPrefixtyped_path::windows::Utf8WindowsPrefixis nowtyped_path::Utf8WindowsPrefix
- Constants are now located within the
constantsmodule, broken out byunixandwindowsmodules to house each set of constants TypedPathandUtf8TypedPathnow match the method signature ofPathfor constructing self with::new(...)- Majority of methods available for
PathandPathBufhave been ported over toTypedPathandTypedPathBuf - Implement
std::fmt::DisplayforUtf8UnixComponent,Utf8WindowsComponent, andUtf8TypedComponent
- Refactor crate exports such that everything other than constants are now
top-level exports
-
0.5.028 Sep 2023Release notes
Open source →- Add
TypedPath,Utf8TypedPath,TypedPathBuf, andUtf8TypedPathBufenums to support code that can operate on both Windows and Unix paths
- Add
-
0.4.220 Sep 2023 -
0.4.118 Sep 2023Release notes
Open source →- Add
AsRef<std::path::Path>forUtf8NativePathandUtf8NativePathBuf - Add
From<Utf8NativePathBuf>forstd::path::PathBuf - Add
rustfmt.tomlto dictate formatting usingcargo +nightly fmt --all
- Add
-
0.4.023 Aug 2023Release notes
Open source →- Add
normalizemethod toPathandUtf8Pathto support resolving.and..across Windows and Unix encodings - Add
is_parentandis_currentmethods toComponentandUtf8Componenttraits with implementations for both Unix and Windows component implementations - Add
root,parent, andcurrentstatic methods toComponentandUtf8Componenttraits to support creating the instances from generics - Add
absolutizeto bothnormalizethe path and - in the case of relative paths - prefix the path with the current working directory - Add
with_encodingtoPathandUtf8Pathsupport converting between the Unix and Windows encoding types - Add
utils::current_dirandutils::utf8_current_dirto retrieve the current working directory as either aPathBuforUtf8PathBuf - Add
with_unix_encodingandwith_windows_encodingtoPathandUtf8Pathsupport converting between the Unix and Windows encoding types - Add
has_unix_encodingandhas_windows_encodingtoPathandUtf8Pathto detect explicit encodings
- Add
-
0.3.227 Mar 2023Release notes
Open source →- Fix implementation of
DisplayforUtf8Pathto use underlying strDisplayinstead ofDebug
- Fix implementation of
-
0.3.114 Mar 2023Release notes
Open source →- Fix joining of empty path with relative path resulting in absolute path when
using
UnixPath::joinorUtf8UnixPath::join(#6)
- Fix joining of empty path with relative path resulting in absolute path when
using
-
0.3.015 Feb 2023Release notes
Open source →- Add
Cloneimplementation forBox<Path<T>>andBox<Utf8Path<T>> - Fix
Cloneimplementation forPathBuf<T>andUtf8PathBuf<T>requiring a clone implementation for the encoding, which is not necessary (#5) - Update
Debugimplementation forPath<T>,Utf8Path<T>,PathBuf<T>, andUtf8PathBuf<T>to no longer require debug implementation for encoding, which is not necessary - Add
labelmethod to encoding implementations, used for debugging purposes
- Add
-
0.2.112 Dec 2022Release notes
Open source →- Update README with more UTF8 examples and add proper testing of README examples via doctest
-
0.2.012 Dec 2022Release notes
Open source →- Added UTF-8 variants of
Path,PathBuf,Components,Component, and other data structures to supportstrversus[u8] - Remove requirements of
Clone,Debug,Display, andSizedonEncodingand subsequent implementationsUnixEncodingandWindowsEncoding
- Added UTF-8 variants of
-
0.1.025 Aug 2022