pub trait Operations {
    type Data: ForeignOwnable + Send + Sync = ();

    const USE_VTABLE_ATTR: ();
    const HAS_INIT: bool = false;
    const HAS_CLEANUP: bool = false;
    const HAS_READ: bool = false;

    fn read(
        data: <Self::Data as ForeignOwnable>::Borrowed<'_>,
        buffer: &mut [u8],
        wait: bool
    ) -> Result<u32>; fn init(_data: <Self::Data as ForeignOwnable>::Borrowed<'_>) -> Result { ... } fn cleanup(_data: Self::Data) { ... } }
Expand description

This trait is implemented in order to provide callbacks to struct hwrng.

Provided Associated Types

The pointer type that will be used to hold user-defined data type.

Required Associated Constants

A marker to prevent implementors from forgetting to use #[vtable] attribute when implementing this trait.

Provided Associated Constants

Indicates if the init method is overridden by the implementor.

Indicates if the cleanup method is overridden by the implementor.

Indicates if the read method is overridden by the implementor.

Required Methods

Read data into the provided buffer. Drivers can fill up to max bytes of data into the buffer. The buffer is aligned for any type and its size is a multiple of 4 and >= 32 bytes.

Provided Methods

Initialization callback, can be left undefined.

Cleanup callback, can be left undefined.

Implementors

This documentation is an old archive. Please see https://rust.docs.kernel.org instead.