DeviceOps

Trait DeviceOps 

Source
pub trait DeviceOps:
    DynClone
    + Send
    + Sync
    + AsAny
    + 'static {
    // Required method
    fn open(
        &self,
        locked: &mut Locked<FileOpsCore>,
        current_task: &CurrentTask,
        device_type: DeviceType,
        node: &NamespaceNode,
        flags: OpenFlags,
    ) -> Result<Box<dyn FileOps>, Errno>;
}

Required Methods§

Source

fn open( &self, locked: &mut Locked<FileOpsCore>, current_task: &CurrentTask, device_type: DeviceType, node: &NamespaceNode, flags: OpenFlags, ) -> Result<Box<dyn FileOps>, Errno>

Instantiate a FileOps for this device.

This function is called when userspace opens a file with a DeviceType assigned to this device.

Implementations on Foreign Types§

Source§

impl DeviceOps for Arc<SerialDevice>

Source§

fn open( &self, _locked: &mut Locked<FileOpsCore>, _current_task: &CurrentTask, _id: DeviceType, _node: &NamespaceNode, _flags: OpenFlags, ) -> Result<Box<dyn FileOps>, Errno>

Implementors§

Source§

impl<F> DeviceOps for F

Allows directly using a function or closure as an implementation of DeviceOps, avoiding having to write a zero-size struct and an impl for it.