pub struct Mode { /* private fields */ }Implementations§
Source§impl Mode
impl Mode
Sourcepub const fn into_bytes(self) -> [u8; 4]
pub const fn into_bytes(self) -> [u8; 4]
Sourcepub const fn from_bytes(bytes: [u8; 4]) -> Self
pub const fn from_bytes(bytes: [u8; 4]) -> Self
Converts the given bytes directly into the bitfield struct.
Source§impl Mode
impl Mode
Sourcepub fn char_len_or_err(
&self,
) -> Result<<CharLen as Specifier>::InOut, InvalidBitPattern<<CharLen as Specifier>::Bytes>>
pub fn char_len_or_err( &self, ) -> Result<<CharLen as Specifier>::InOut, InvalidBitPattern<<CharLen as Specifier>::Bytes>>
Returns the value of char_len.
#Errors
If the returned value contains an invalid bit pattern for char_len.
Sourcepub fn with_char_len(self, new_val: <CharLen as Specifier>::InOut) -> Self
pub fn with_char_len(self, new_val: <CharLen as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of char_len set to the given value.
#Panics
If the given value is out of bounds for char_len.
Sourcepub fn with_char_len_checked(
self,
new_val: <CharLen as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_char_len_checked( self, new_val: <CharLen as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of char_len set to the given value.
#Errors
If the given value is out of bounds for char_len.
Sourcepub fn set_char_len(&mut self, new_val: <CharLen as Specifier>::InOut)
pub fn set_char_len(&mut self, new_val: <CharLen as Specifier>::InOut)
Sets the value of char_len to the given value.
#Panics
If the given value is out of bounds for char_len.
Sourcepub fn set_char_len_checked(
&mut self,
new_val: <CharLen as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_char_len_checked( &mut self, new_val: <CharLen as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of char_len to the given value.
#Errors
If the given value is out of bounds for char_len.
Sourcepub fn parity_or_err(
&self,
) -> Result<<Parity as Specifier>::InOut, InvalidBitPattern<<Parity as Specifier>::Bytes>>
pub fn parity_or_err( &self, ) -> Result<<Parity as Specifier>::InOut, InvalidBitPattern<<Parity as Specifier>::Bytes>>
Returns the value of parity.
#Errors
If the returned value contains an invalid bit pattern for parity.
Sourcepub fn with_parity(self, new_val: <Parity as Specifier>::InOut) -> Self
pub fn with_parity(self, new_val: <Parity as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of parity set to the given value.
#Panics
If the given value is out of bounds for parity.
Sourcepub fn with_parity_checked(
self,
new_val: <Parity as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_parity_checked( self, new_val: <Parity as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of parity set to the given value.
#Errors
If the given value is out of bounds for parity.
Sourcepub fn set_parity(&mut self, new_val: <Parity as Specifier>::InOut)
pub fn set_parity(&mut self, new_val: <Parity as Specifier>::InOut)
Sets the value of parity to the given value.
#Panics
If the given value is out of bounds for parity.
Sourcepub fn set_parity_checked(
&mut self,
new_val: <Parity as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_parity_checked( &mut self, new_val: <Parity as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of parity to the given value.
#Errors
If the given value is out of bounds for parity.
Sourcepub fn n_stop_bits(&self) -> <NumStopBits as Specifier>::InOut
pub fn n_stop_bits(&self) -> <NumStopBits as Specifier>::InOut
Returns the value of n_stop_bits.
Sourcepub fn n_stop_bits_or_err(
&self,
) -> Result<<NumStopBits as Specifier>::InOut, InvalidBitPattern<<NumStopBits as Specifier>::Bytes>>
pub fn n_stop_bits_or_err( &self, ) -> Result<<NumStopBits as Specifier>::InOut, InvalidBitPattern<<NumStopBits as Specifier>::Bytes>>
Returns the value of n_stop_bits.
#Errors
If the returned value contains an invalid bit pattern for n_stop_bits.
Sourcepub fn with_n_stop_bits(
self,
new_val: <NumStopBits as Specifier>::InOut,
) -> Self
pub fn with_n_stop_bits( self, new_val: <NumStopBits as Specifier>::InOut, ) -> Self
Returns a copy of the bitfield with the value of n_stop_bits set to the given value.
#Panics
If the given value is out of bounds for n_stop_bits.
Sourcepub fn with_n_stop_bits_checked(
self,
new_val: <NumStopBits as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_n_stop_bits_checked( self, new_val: <NumStopBits as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of n_stop_bits set to the given value.
#Errors
If the given value is out of bounds for n_stop_bits.
Sourcepub fn set_n_stop_bits(&mut self, new_val: <NumStopBits as Specifier>::InOut)
pub fn set_n_stop_bits(&mut self, new_val: <NumStopBits as Specifier>::InOut)
Sets the value of n_stop_bits to the given value.
#Panics
If the given value is out of bounds for n_stop_bits.
Sourcepub fn set_n_stop_bits_checked(
&mut self,
new_val: <NumStopBits as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_n_stop_bits_checked( &mut self, new_val: <NumStopBits as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of n_stop_bits to the given value.
#Errors
If the given value is out of bounds for n_stop_bits.