pub fn new() -> Result<IoMasterPort> {
        let mut master_port: port::mach_port_t = port::MACH_PORT_NULL;

        let result = unsafe { ffi::IOMasterPort(ffi::kIOMasterPortDefault, &mut master_port) };

        if result != kern_return::KERN_SUCCESS {
            Err(Error::last_os_error().with_ffi("IOMasterPort"))
        } else {
            Ok(IoMasterPort(master_port))
        }
    }
/// Gets the new IO master port for communication with IOKit.
Gets the new IO master port for communication with IOKit.
Gets the new IO master port for communication with IOKit .
pub fn new() -> Result<IoMasterPort> {
        let mut master_port: port::mach_port_t = port::MACH_PORT_NULL;
        let result = unsafe { ffi::IOMasterPort(ffi::kIOMasterPortDefault, &mut master_port) };
        if result != kern_return::KERN_SUCCESS {
            Err(Error::last_os_error().with_ffi("IOMasterPort"))
        } else {
            Ok(IoMasterPort(master_port))
        }
    }
pub fn new ( ) -> Result < IoMasterPort > { let mut master_port : port :: mach_port_t = port :: MACH_PORT_NULL ; let result = unsafe { ffi :: IOMasterPort ( ffi :: kIOMasterPortDefault , & mut master_port ) } ; if result != kern_return :: KERN_SUCCESS { Err ( Error :: last_os_error ( ) . with_ffi ( " " ) ) } else { Ok ( IoMasterPort ( master_port ) ) } }
Gets the new IO master port for communication with IOKit.
Gets the new IO master port for communication with IOKit .