Struct PortGeneric
pub struct PortGeneric<T, A> {
port: u16,
phantom: PhantomData<(T, A)>,
}Expand description
An I/O port.
The port reads or writes values of type T and has read/write access specified by A.
Use the provided marker types or aliases to get a port type with the access you need:
PortGeneric<T, ReadWriteAccess>->Port<T>PortGeneric<T, ReadOnlyAccess>->PortReadOnly<T>PortGeneric<T, WriteOnlyAccess>->PortWriteOnly<T>
Fields§
§port: u16§phantom: PhantomData<(T, A)>Implementations§
§impl<T, A> PortGeneric<T, A>
impl<T, A> PortGeneric<T, A>
pub const fn new(port: u16) -> PortGeneric<T, A>
pub const fn new(port: u16) -> PortGeneric<T, A>
Creates an I/O port with the given port number.
§impl<T, A> PortGeneric<T, A>where
T: PortRead,
A: PortReadAccess,
impl<T, A> PortGeneric<T, A>where
T: PortRead,
A: PortReadAccess,
§impl<T, A> PortGeneric<T, A>where
T: PortWrite,
A: PortWriteAccess,
impl<T, A> PortGeneric<T, A>where
T: PortWrite,
A: PortWriteAccess,
Trait Implementations§
§impl<T, A> Clone for PortGeneric<T, A>
impl<T, A> Clone for PortGeneric<T, A>
§fn clone(&self) -> PortGeneric<T, A>
fn clone(&self) -> PortGeneric<T, A>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl<T, A> Debug for PortGeneric<T, A>where
A: PortAccess,
impl<T, A> Debug for PortGeneric<T, A>where
A: PortAccess,
impl<T, A> Eq for PortGeneric<T, A>
Auto Trait Implementations§
impl<T, A> Freeze for PortGeneric<T, A>
impl<T, A> RefUnwindSafe for PortGeneric<T, A>where
T: RefUnwindSafe,
A: RefUnwindSafe,
impl<T, A> Send for PortGeneric<T, A>
impl<T, A> Sync for PortGeneric<T, A>
impl<T, A> Unpin for PortGeneric<T, A>
impl<T, A> UnsafeUnpin for PortGeneric<T, A>
impl<T, A> UnwindSafe for PortGeneric<T, A>where
T: UnwindSafe,
A: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more