Expand description
A crate to control the tray of your CD drive.
Device
contains methods to open drives and send commands to them.
cd_drives
allows you to find all CD drives on a system.
§Example
use eject::{device::Device, discovery::cd_drives};
// Open the drive at this path
let cdrom = Device::open("/dev/cdrom")?;
// Or get the first one available
let cdrom_path = cd_drives().next().unwrap();
let cdrom = Device::open(&cdrom_path)?;
// Open the tray
cdrom.eject()?;