pub struct FrameBuilder<T> { /* private fields */ }Expand description
A builder for Frames.
Implementations§
Source§impl<T: Pdu> FrameBuilder<T>
impl<T: Pdu> FrameBuilder<T>
Sourcepub const fn with_pdu(unit_id: u8, pdu: T) -> Self
pub const fn with_pdu(unit_id: u8, pdu: T) -> Self
Creates a new builder with the given unit ID and PDU.
This is different from Frame::new in that no CRC is calculated at
this point.
Sourcepub const fn new(unit_id: u8) -> Self
pub const fn new(unit_id: u8) -> Self
Creates a new builder with the given unit ID and default PDU value.
Sourcepub const fn set_unit_id(&mut self, unit_id: u8)
pub const fn set_unit_id(&mut self, unit_id: u8)
Changes the unit ID.
Sourcepub fn build_ref(&mut self) -> &mut Frame<T>
pub fn build_ref(&mut self) -> &mut Frame<T>
Build a frame but don’t move it out of the builder, so that the builder can be recycled.
Trait Implementations§
Source§impl<T: Debug> Debug for FrameBuilder<T>
impl<T: Debug> Debug for FrameBuilder<T>
Auto Trait Implementations§
impl<T> Freeze for FrameBuilder<T>where
T: Freeze,
impl<T> RefUnwindSafe for FrameBuilder<T>where
T: RefUnwindSafe,
impl<T> Send for FrameBuilder<T>where
T: Send,
impl<T> Sync for FrameBuilder<T>where
T: Sync,
impl<T> Unpin for FrameBuilder<T>where
T: Unpin,
impl<T> UnsafeUnpin for FrameBuilder<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for FrameBuilder<T>where
T: UnwindSafe,
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