Struct UserIO

Source
pub struct UserIO<Interface: IoInterface, Access: IoAccessKind = ReadWrite, OwnKind: OwnStrictness = Owned> { /* private fields */ }
Expand description

Userspace access to IO devices

§Currently Supported Interfaces

  • CpuIO CPU IO Port bus access

§Why use this type?

UserIO represents an ‘owned’ access over some IO device on the system. This is important because future processes will not be able to access this IO device until it is dropped.

This type also attempts to implment the interface to access such hardware device in the safest possible way.

Implementations§

Source§

impl<Access: IoAccessKind, OwnKind: OwnStrictness> UserIO<CpuIO, Access, OwnKind>

Source

pub unsafe fn new(address: u16) -> Self

Create a new CpuIO port for access in userspace.

Source§

impl<Access: IoAccessKind, OwnKind: OwnStrictness> UserIO<CpuIO, Access, OwnKind>
where UserIO<CpuIO, Access, OwnKind>: IoSupportsReading,

Source

pub unsafe fn read_u8(&self) -> u8

Source

pub unsafe fn read_u16(&self) -> u16

Source§

impl<Access: IoAccessKind, OwnKind: OwnStrictness> UserIO<CpuIO, Access, OwnKind>
where UserIO<CpuIO, Access, OwnKind>: IoSupportsWritting,

Source

pub unsafe fn write_u8(&mut self, value: u8)

Source

pub unsafe fn write_u16(&mut self, value: u16)

Trait Implementations§

Source§

impl<Interface: IoInterface, Owner: OwnStrictness> IoSupportsReadWrite for UserIO<Interface, ReadWrite, Owner>

Source§

impl<Interface: IoInterface, Owner: OwnStrictness> IoSupportsReading for UserIO<Interface, ReadOnly, Owner>

Source§

impl<Interface: IoInterface, Owner: OwnStrictness> IoSupportsReading for UserIO<Interface, ReadWrite, Owner>

Source§

impl<Interface: IoInterface, Owner: OwnStrictness> IoSupportsWritting for UserIO<Interface, ReadWrite, Owner>

Source§

impl<Interface: IoInterface, Owner: OwnStrictness> IoSupportsWritting for UserIO<Interface, WriteOnly, Owner>

Auto Trait Implementations§

§

impl<Interface, Access, OwnKind> Freeze for UserIO<Interface, Access, OwnKind>
where Interface: Freeze,

§

impl<Interface, Access, OwnKind> RefUnwindSafe for UserIO<Interface, Access, OwnKind>
where Interface: RefUnwindSafe, Access: RefUnwindSafe, OwnKind: RefUnwindSafe,

§

impl<Interface, Access, OwnKind> Send for UserIO<Interface, Access, OwnKind>
where Interface: Send, Access: Send, OwnKind: Send,

§

impl<Interface, Access, OwnKind> Sync for UserIO<Interface, Access, OwnKind>
where Interface: Sync, Access: Sync, OwnKind: Sync,

§

impl<Interface, Access, OwnKind> Unpin for UserIO<Interface, Access, OwnKind>
where Interface: Unpin, Access: Unpin, OwnKind: Unpin,

§

impl<Interface, Access, OwnKind> UnwindSafe for UserIO<Interface, Access, OwnKind>
where Interface: UnwindSafe, Access: UnwindSafe, OwnKind: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.