Skip to content
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

impl<T: AsRawFd> AsRawFd for {Arc,Box}<T> #97437

Merged
merged 2 commits into from
Jul 3, 2022

Commits on Jun 22, 2022

  1. impl<T: AsRawFd> for {Arc,Box}<T>

    This allows implementing traits that require a raw FD on Arc and Box.
    
    Previously, you'd have to add the function to the trait itself:
    
    ```rust
    trait MyTrait {
        fn as_raw_fd(&self) -> RawFd;
    }
    
    impl<T: MyTrait> MyTrait for Arc<T> {
        fn as_raw_fd(&self) -> RawFd {
            (**self).as_raw_fd()
        }
    }
    ```
    jyn514 committed Jun 22, 2022
    Configuration menu
    Copy the full SHA
    ed1e351 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cf483a1 View commit details
    Browse the repository at this point in the history