pub struct Frame { /* private fields */ }Expand description
One command: the opcode, and the payload that follows it.
A frame is the whole of what goes out for one command, so a caller writes the opcode and then the payload and does not have to know which commands take one.
Implementations§
Source§impl Frame
impl Frame
Sourcepub fn payload(&self) -> &[u8] ⓘ
pub fn payload(&self) -> &[u8] ⓘ
What follows the opcode.
§Returns
The payload, which is empty for the commands that take none.
§Examples
use pamoja_radios::sx1302::sx1261::{standby, Standby, free_running};
assert_eq!(standby(Standby::Rc).payload(), &[0x00]);
assert!(free_running().payload().is_empty(), "this one takes no payload");Trait Implementations§
impl Copy for Frame
impl Eq for Frame
impl StructuralPartialEq for Frame
Auto Trait Implementations§
impl Freeze for Frame
impl RefUnwindSafe for Frame
impl Send for Frame
impl Sync for Frame
impl Unpin for Frame
impl UnsafeUnpin for Frame
impl UnwindSafe for Frame
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