pub struct GetSet<'a, P, T, const START: usize, const STOP: usize> { /* private fields */ }
Expand description

A struct which allows for getting/setting a given property

Implementations

The bit offset at which this GetSet instance starts

The bit offset at which this GetSet instance ends

Create a new GetSet. This should be called from methods generated by the bit_struct macro

Get the property this GetSet points at

Returns true if the memory this GetSet points at is a valid representation of T

Get the raw bits being pointed at, without type conversion nor any form of validation

Set the property in the slice being pointed to by this GetSet

Set the field to a raw value.

Safety

value must be a valid representation of the field. i.e., core::mem::transmute between P and T must be defined.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.