/// Opens a device file corresponding to the device identifier `dev`.
Opens a device file corresponding to the device identifier `dev`.
Opens a device file corresponding to the device identifier ` dev ` .
pub fn open_device(
        &self,
        node: &FsNode,
        flags: OpenFlags,
        dev: DeviceType,
        mode: DeviceMode,
    ) -> Result<Box<dyn FileOps>, Errno> {
        match mode {
            DeviceMode::Char => {
                self.char_devices.get(&dev).ok_or_else(|| errno!(ENODEV))?.open(node, flags)
            }
            DeviceMode::Block => error!(ENODEV),
        }
    }
pub fn open_device ( & self , node : & FsNode , flags : OpenFlags , dev : DeviceType , mode : DeviceMode , ) -> Result < Box < dyn FileOps > , Errno > { match mode { DeviceMode :: Char => { self . char_devices . get ( & dev ) . ok_or_else ( | | errno ! ( ENODEV ) ) ? . open ( node , flags ) } DeviceMode :: Block => error ! ( ENODEV ) , } }
Opens a device file corresponding to the device identifier `dev`.
Opens a device file corresponding to the device identifier ` dev ` .
&self
node
&FsNode
flags
OpenFlags
dev
DeviceType
mode
DeviceMode