Skip to main content

Host

Struct Host 

Source
pub struct Host<'d, C: HostController> { /* private fields */ }
Expand description

The root port of a host controller.

This is the entry point of the stack: it reports the port, resets it and enumerates what is attached. Everything else hangs off the Device that enumerate returns.

Implementations§

Source§

impl<'d, C: HostController> Host<'d, C>

Source

pub const fn new(controller: &'d C) -> Self

Wrap a controller. The controller must be powered up already.

Source

pub fn port(&self) -> PortStatus

Read the root port without changing anything.

Source

pub fn reset(&self) -> HostResult<PortStatus>

Power the port, drive a bus reset and report the negotiated speed.

A device has to be attached; this is what enumeration starts with.

Source

pub fn wait_for_device(&self) -> HostResult<PortStatus>

Wait up to a second for a device to be attached.

Source

pub fn enumerate(&self) -> HostResult<Device<'d, C>>

Reset the port and enumerate the attached device at the first free address.

Source

pub fn enumerate_at(&self, address: DeviceAddress) -> HostResult<Device<'d, C>>

Reset the port and enumerate the attached device at address.

Auto Trait Implementations§

§

impl<'d, C> Forget for Host<'d, C>

§

impl<'d, C> Freeze for Host<'d, C>
where &'d C: Freeze,

§

impl<'d, C> Move for Host<'d, C>

§

impl<'d, C> RefUnwindSafe for Host<'d, C>

§

impl<'d, C> Send for Host<'d, C>
where &'d C: Send,

§

impl<'d, C> Sync for Host<'d, C>
where &'d C: Sync,

§

impl<'d, C> Unpin for Host<'d, C>
where &'d C: Unpin,

§

impl<'d, C> UnsafeUnpin for Host<'d, C>

§

impl<'d, C> UnwindSafe for Host<'d, C>

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.