[][src]Struct ksz8863::smi::Reg

pub struct Reg<'smi, T, R> {
    pub smi: &'smi mut Smi<T>,
    // some fields omitted
}

A wrapper around an miim::Read and/or miim::Write implementation for a particular SMI register.

Fields

smi: &'smi mut Smi<T>

Implementations

impl<'smi, T, R> Reg<'smi, T, R> where
    R: Register
[src]

pub fn read(&mut self) -> Result<R, T::Error> where
    T: Read
[src]

Read the value from register R via SMI.

pub fn write<F>(&mut self, write: F) -> Result<(), T::Error> where
    T: Write,
    F: for<'a, 'b> FnOnce(&'a mut W<&'b mut R>) -> &'a mut W<&'b mut R>, 
[src]

Write to the register R, initialised with a default state.

pub fn modify<F, E>(&mut self, modify: F) -> Result<(), E> where
    T: Read<Error = E> + Write<Error = E>,
    F: for<'a, 'b> FnOnce(&'a mut W<&'b mut R>) -> &'a mut W<&'b mut R>, 
[src]

Modify the register R.

This first reads the value from the register, delivers it to the user via the modify function, and then writes the result.

Auto Trait Implementations

impl<'smi, T, R> Send for Reg<'smi, T, R> where
    R: Send,
    T: Send
[src]

impl<'smi, T, R> Sync for Reg<'smi, T, R> where
    R: Sync,
    T: Sync
[src]

impl<'smi, T, R> Unpin for Reg<'smi, T, R> where
    R: Unpin
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.