pub struct ControlFrame { /* private fields */ }Expand description
A variable-format frame without user data.
Implementations§
Source§impl ControlFrame
impl ControlFrame
Sourcepub const fn new(
control: Control,
address: Address,
control_information: u8,
) -> Result<Self, ControlFrameError>
pub const fn new( control: Control, address: Address, control_information: u8, ) -> Result<Self, ControlFrameError>
Creates a validated control frame.
Sourcepub const fn control_information(&self) -> u8
pub const fn control_information(&self) -> u8
Returns the control-information byte.
Sourcepub fn decode(bytes: &[u8]) -> Result<Self, ControlFrameError>
pub fn decode(bytes: &[u8]) -> Result<Self, ControlFrameError>
Decodes exactly one control frame.
Sourcepub fn encode_into<'a>(
&self,
output: &'a mut [u8],
) -> Result<&'a [u8], ControlFrameError>
pub fn encode_into<'a>( &self, output: &'a mut [u8], ) -> Result<&'a [u8], ControlFrameError>
Encodes the frame into output and returns the encoded portion.
Trait Implementations§
Source§impl Clone for ControlFrame
impl Clone for ControlFrame
Source§fn clone(&self) -> ControlFrame
fn clone(&self) -> ControlFrame
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 moreimpl Copy for ControlFrame
Source§impl Debug for ControlFrame
impl Debug for ControlFrame
impl Eq for ControlFrame
Source§impl From<ControlFrame> for Frame
impl From<ControlFrame> for Frame
Source§fn from(frame: ControlFrame) -> Self
fn from(frame: ControlFrame) -> Self
Converts to this type from the input type.
Source§impl Hash for ControlFrame
impl Hash for ControlFrame
Source§impl PartialEq for ControlFrame
impl PartialEq for ControlFrame
impl StructuralPartialEq for ControlFrame
Auto Trait Implementations§
impl Freeze for ControlFrame
impl RefUnwindSafe for ControlFrame
impl Send for ControlFrame
impl Sync for ControlFrame
impl Unpin for ControlFrame
impl UnsafeUnpin for ControlFrame
impl UnwindSafe for ControlFrame
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