pub struct Options<'a> { /* private fields */ }
Expand description
Options which can be used to configure how a misc device is registered.
Examples
fn example(
reg: Pin<&mut miscdev::Registration<impl file::Operations<OpenData = ()>>>,
parent: &dyn RawDevice,
) -> Result {
miscdev::Options::new()
.mode(0o600)
.minor(10)
.parent(parent)
.register(reg, fmt!("sample"), ())
}
Implementations
sourceimpl<'a> Options<'a>
impl<'a> Options<'a>
sourcepub const fn mode(&mut self, m: u16) -> &mut Self
pub const fn mode(&mut self, m: u16) -> &mut Self
Sets the device mode.
This is usually an octal number and describes who can perform read/write/execute operations on the device.
sourcepub fn register<T: Operations>(
&self,
reg: Pin<&mut Registration<T>>,
name: Arguments<'_>,
open_data: T::OpenData
) -> Result
pub fn register<T: Operations>(
&self,
reg: Pin<&mut Registration<T>>,
name: Arguments<'_>,
open_data: T::OpenData
) -> Result
Registers a misc device using the configured options.
sourcepub fn register_new<T: Operations>(
&self,
name: Arguments<'_>,
open_data: T::OpenData
) -> Result<Pin<Box<Registration<T>>>>
pub fn register_new<T: Operations>(
&self,
name: Arguments<'_>,
open_data: T::OpenData
) -> Result<Pin<Box<Registration<T>>>>
Allocates a new registration of a misc device and completes the registration with the configured options.
Trait Implementations
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Options<'a>
impl<'a> !Send for Options<'a>
impl<'a> !Sync for Options<'a>
impl<'a> Unpin for Options<'a>
impl<'a> !UnwindSafe for Options<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more