Skip to main content

BulkRegisterOperation

Struct BulkRegisterOperation 

Source
pub struct BulkRegisterOperation<'b, B, AddressType: Address, Fieldsets, Access> { /* private fields */ }
Expand description

A register operation for reading or writing multiple registers in one transaction

Implementations§

Source§

impl<'b, B, AddressType, FieldSets> BulkRegisterOperation<'b, B, AddressType, FieldSets, WO>
where B: Block, B::RegisterAddressMode: AddressMode, AddressType: Address,

Source

pub fn with<FS: Fieldset, LocalAccess: WriteCapability>( self, f: impl FnOnce(&mut B) -> Plan<AddressType, FS, LocalAccess>, ) -> BulkRegisterOperation<'b, B, AddressType, FieldSets::Appended, WO>
where FieldSets: Append<FS>,

Chain an extra write onto the bulk-write.

The closure must return a plan for the register you want to write. The plan is created by calling RegisterOperation::plan or RegisterOperation::plan_with_zero.

After chaining, call Self::execute.

Source§

impl<'b, B, AddressType, FieldSets> BulkRegisterOperation<'b, B, AddressType, FieldSets, RO>
where B: Block, B::RegisterAddressMode: AddressMode, AddressType: Address,

Source

pub fn with<FS: Fieldset, LocalAccess: ReadCapability>( self, f: impl FnOnce(&mut B) -> Plan<AddressType, FS, LocalAccess>, ) -> BulkRegisterOperation<'b, B, AddressType, FieldSets::Appended, RO>
where FieldSets: Append<FS>,

Chain an extra read onto the bulk-read.

The closure must return a plan for the register you want to read. The plan is created by calling RegisterOperation::plan.

After chaining, call Self::execute.

Source§

impl<'b, B, AddressType, FieldSets> BulkRegisterOperation<'b, B, AddressType, FieldSets, RW>
where B: Block, B::RegisterAddressMode: AddressMode, AddressType: Address,

Source

pub fn with<FS: Fieldset, LocalAccess: ReadCapability + WriteCapability>( self, f: impl FnOnce(&mut B) -> Plan<AddressType, FS, LocalAccess>, ) -> BulkRegisterOperation<'b, B, AddressType, FieldSets::Appended, RW>
where FieldSets: Append<FS>,

Chain an extra modify onto the bulk-modify.

The closure must return a plan for the register you want to modify. The plan is created by calling RegisterOperation::plan.

After chaining, call Self::execute.

Source§

impl<B, Fieldsets> BulkRegisterOperation<'_, B, <B::Interface as RegisterInterfaceBase>::AddressType, Fieldsets, RO>
where B: Block, B::Interface: RegisterInterfaceBase, Fieldsets: Fieldset + ToTuple,

Source

pub fn execute( self, ) -> Result<Fieldsets::Tuple, <B::Interface as RegisterInterfaceBase>::Error>

Execute the read.

If ok, the fieldset values are returned as a tuple. If the bulk-read was illegal or the read failed, an error is returned.

Source

pub async fn execute_async( self, ) -> Result<Fieldsets::Tuple, <B::Interface as RegisterInterfaceBase>::Error>

Execute the read.

If ok, the fieldset values are returned as a tuple. If the bulk-read was illegal or the read failed, an error is returned.

Source§

impl<B, Fieldsets> BulkRegisterOperation<'_, B, <B::Interface as RegisterInterfaceBase>::AddressType, Fieldsets, WO>
where B: Block, B::Interface: RegisterInterfaceBase, Fieldsets: Fieldset, for<'a> &'a mut Fieldsets: ToTuple,

Source

pub fn execute( self, f: impl FnOnce(<&mut Fieldsets as ToTuple>::Tuple), ) -> Result<(), <B::Interface as RegisterInterfaceBase>::Error>

Execute the write.

Use the closure to change contents of the fieldset values that will be written. The fieldset values are either the reset value or all-0’s based on which plan was used in the chaining phase.

If ok, the return value of the closure is returned. If the bulk-write was illegal or the read failed, an error is returned.

Source

pub fn execute_async( self, f: impl FnOnce(<&mut Fieldsets as ToTuple>::Tuple), ) -> impl Future<Output = Result<(), <B::Interface as RegisterInterfaceBase>::Error>>

Execute the write.

Use the closure to change contents of the fieldset values that will be written. The fieldset values are either the reset value or all-0’s based on which plan was used in the chaining phase.

If ok, the return value of the closure is returned. If the bulk-write was illegal or the read failed, an error is returned.

Source§

impl<B, Fieldsets> BulkRegisterOperation<'_, B, <B::Interface as RegisterInterfaceBase>::AddressType, Fieldsets, RW>
where B: Block, B::Interface: RegisterInterfaceBase, Fieldsets: Fieldset, for<'a> &'a mut Fieldsets: ToTuple,

Source

pub fn execute( self, f: impl FnOnce(<&mut Fieldsets as ToTuple>::Tuple), ) -> Result<(), <B::Interface as RegisterInterfaceBase>::Error>

Execute the modify.

Use the closure to change contents of the fieldset values that have been read. The modified values will be written back to the device.

If ok, the return value of the closure is returned. If the bulk-modify was illegal or the read failed, an error is returned.

Source

pub async fn execute_async( self, f: impl FnOnce(<&mut Fieldsets as ToTuple>::Tuple), ) -> Result<(), <B::Interface as RegisterInterfaceBase>::Error>

Execute the modify.

Use the closure to change contents of the fieldset values that have been read. The modified values will be written back to the device.

If ok, the return value of the closure is returned. If the bulk-modify was illegal or the read failed, an error is returned.

Auto Trait Implementations§

§

impl<'b, B, AddressType, Fieldsets, Access> !UnwindSafe for BulkRegisterOperation<'b, B, AddressType, Fieldsets, Access>

§

impl<'b, B, AddressType, Fieldsets, Access> Freeze for BulkRegisterOperation<'b, B, AddressType, Fieldsets, Access>
where Fieldsets: Freeze, AddressType: Freeze,

§

impl<'b, B, AddressType, Fieldsets, Access> RefUnwindSafe for BulkRegisterOperation<'b, B, AddressType, Fieldsets, Access>
where Fieldsets: RefUnwindSafe, B: RefUnwindSafe, AddressType: RefUnwindSafe, Access: RefUnwindSafe,

§

impl<'b, B, AddressType, Fieldsets, Access> Send for BulkRegisterOperation<'b, B, AddressType, Fieldsets, Access>
where Fieldsets: Send, B: Send, AddressType: Send, Access: Send,

§

impl<'b, B, AddressType, Fieldsets, Access> Sync for BulkRegisterOperation<'b, B, AddressType, Fieldsets, Access>
where Fieldsets: Sync, B: Sync, AddressType: Sync, Access: Sync,

§

impl<'b, B, AddressType, Fieldsets, Access> Unpin for BulkRegisterOperation<'b, B, AddressType, Fieldsets, Access>
where Fieldsets: Unpin, AddressType: Unpin, Access: Unpin,

§

impl<'b, B, AddressType, Fieldsets, Access> UnsafeUnpin for BulkRegisterOperation<'b, B, AddressType, Fieldsets, Access>
where Fieldsets: UnsafeUnpin, AddressType: UnsafeUnpin,

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.