pub struct Ax25Frame {
pub source: Address,
pub destination: Address,
pub route: Vec<RouteEntry>,
pub command_or_response: Option<CommandResponse>,
pub content: FrameContent,
}
Expand description
A strongly-typed representation of a single AX.25 frame.
Fields§
§source: Address
Sending station
destination: Address
Destination station
route: Vec<RouteEntry>
The route the frame has taken/will take according to repeater entries in the address field
command_or_response: Option<CommandResponse>
AX.25 2.0-compliant stations will indicate in every frame whether it is a command or a response, as part of the address field.
content: FrameContent
Various content depending on the packet type
Implementations§
source§impl Ax25Frame
impl Ax25Frame
sourcepub fn info_string_lossy(&self) -> Option<String>
pub fn info_string_lossy(&self) -> Option<String>
Returns a UTF-8 string that is a “best effort” at displaying the information
content of this frame. Returns None if there is no information field present.
Most applications will need to work with the Vec
sourcepub fn from_bytes(bytes: &[u8]) -> Result<Ax25Frame, FrameParseError>
pub fn from_bytes(bytes: &[u8]) -> Result<Ax25Frame, FrameParseError>
Parse raw bytes into an Ax25Frame if possible.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Ax25Frame
impl Send for Ax25Frame
impl Sync for Ax25Frame
impl Unpin for Ax25Frame
impl UnwindSafe for Ax25Frame
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