Skip to content

Implement async Path & PathBuf #320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 42 commits into from
Oct 15, 2019
Merged

Conversation

Wassasin
Copy link
Contributor

@Wassasin Wassasin commented Oct 13, 2019

Partially closes #183. Tracking PR as quite a lot of methods need to be implemented.

PathBuf

  • path::PathBuf::as_path
  • path::PathBuf::into_boxed_path
  • path::PathBuf::into_os_string
  • path::PathBuf::new
  • path::PathBuf::pop
  • path::PathBuf::push
  • path::PathBuf::set_extension
  • path::PathBuf::set_file_name

Path

  • path::Path::ancestors
  • path::Path::as_os_str
  • path::Path::canonicalize
  • path::Path::components
  • path::Path::display
  • path::Path::ends_with
  • path::Path::exists
  • path::Path::extension
  • path::Path::file_name
  • path::Path::file_stem
  • path::Path::has_root
  • path::Path::into_path_buf
  • path::Path::is_absolute
  • path::Path::is_dir
  • path::Path::is_file
  • path::Path::is_relative
  • path::Path::iter
  • path::Path::join
  • path::Path::metadata
  • path::Path::new
  • path::Path::parent
  • path::Path::read_dir
  • path::Path::read_link
  • path::Path::starts_with
  • path::Path::strip_prefix
  • path::Path::symlink_metadata
  • path::Path::to_path_buf
  • path::Path::to_str
  • path::Path::to_string_lossy
  • path::Path::with_extension
  • path::Path::with_file_name

@Wassasin
Copy link
Contributor Author

@yoshuawuyts I'm unsure as how to feature gate the unstable path_buf_capacity feature within async-std. The remaining methods depend on this feature.

Also the ancestors method yields and iterator over std::path::Path, instead of our own Path. It may be worth considering mapping this iterator and yielding impl iterator<Item=Path>.

@ghost
Copy link

ghost commented Oct 14, 2019

I'm unsure as how to feature gate the unstable path_buf_capacity feature within async-std. The remaining methods depend on this feature.

Let's just omit unstable functions from the standard library.

Also the ancestors method yields and iterator over std::path::Path, instead of our own Path. It may be worth considering mapping this iterator and yielding impl iterator<Item=Path>.

We should define our own Ancestors iterator instead of re-exporting the one from std.

@Wassasin Wassasin marked this pull request as ready for review October 14, 2019 20:05
Copy link
Contributor

@yoshuawuyts yoshuawuyts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great; let's merge this!

@yoshuawuyts yoshuawuyts merged commit 00a8433 into async-rs:master Oct 15, 2019
@yoshuawuyts
Copy link
Contributor

yoshuawuyts commented Oct 15, 2019

@Wassasin thanks so much for all your work on this! This is fantastic!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[tracking] path
2 participants