objc2-core-foundation 0.3.1

Bindings to the CoreFoundation framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#![cfg(unix)] // std::os::fd only available on unix platforms.
use std::os::fd::{AsRawFd, RawFd};

use crate::CFFileDescriptor;

impl AsRawFd for CFFileDescriptor {
    fn as_raw_fd(&self) -> RawFd {
        self.native_descriptor()
    }
}

// NOTE: We cannot implement `AsFd`, since if `CFFileDescriptor` was created
// with `closeOnInvalidate`, the user could close the file descriptor while
// the `BorrowedFd` was alive, thus breaking its invariant.