#[repr(transparent)]pub struct SSDVPacketArray<P: SSDVParameters>(pub GenericArray<u8, P::PacketLen>);Expand description
SSDV packet stored in a GenericArray.
This struct stores an SSDV packet in a GenericArray transparently (so
the packet has the same ABI as an array [u8; N]). The struct implements
the SSDVPacket trait by using the parameters defined in the
SSDVParameters implementation of the type parameter P.
Tuple Fields§
§0: GenericArray<u8, P::PacketLen>Implementations§
Source§impl<P: SSDVParameters> SSDVPacketArray<P>
impl<P: SSDVParameters> SSDVPacketArray<P>
Sourcepub fn new_from_slice(slice: &[u8]) -> Result<Self, LengthError>
pub fn new_from_slice(slice: &[u8]) -> Result<Self, LengthError>
Creates a new SSDV packet from a slice.
This function creates a new SSDV packet by copying the data in
slice. If the length of slice is different from the SSDV packet
length specified by P::PacketLen, an error is returned.
Trait Implementations§
Source§impl<P: SSDVParameters> Clone for SSDVPacketArray<P>
impl<P: SSDVParameters> Clone for SSDVPacketArray<P>
Source§impl<P: SSDVParameters> Debug for SSDVPacketArray<P>
impl<P: SSDVParameters> Debug for SSDVPacketArray<P>
Source§impl<P: SSDVParameters> Default for SSDVPacketArray<P>
impl<P: SSDVParameters> Default for SSDVPacketArray<P>
Source§impl<P: SSDVParameters> From<GenericArray<u8, <P as SSDVParameters>::PacketLen>> for SSDVPacketArray<P>
impl<P: SSDVParameters> From<GenericArray<u8, <P as SSDVParameters>::PacketLen>> for SSDVPacketArray<P>
Source§impl<P: SSDVParameters> From<SSDVPacketArray<P>> for GenericArray<u8, P::PacketLen>
impl<P: SSDVParameters> From<SSDVPacketArray<P>> for GenericArray<u8, P::PacketLen>
Source§fn from(value: SSDVPacketArray<P>) -> Self
fn from(value: SSDVPacketArray<P>) -> Self
Converts to this type from the input type.
Source§impl<P: SSDVParameters> Hash for SSDVPacketArray<P>
impl<P: SSDVParameters> Hash for SSDVPacketArray<P>
Source§impl<P: SSDVParameters> PartialEq for SSDVPacketArray<P>
impl<P: SSDVParameters> PartialEq for SSDVPacketArray<P>
Source§impl<P: SSDVParameters> SSDVPacket for SSDVPacketArray<P>
impl<P: SSDVParameters> SSDVPacket for SSDVPacketArray<P>
Source§type DataLen = <P as SSDVParameters>::DataLen
type DataLen = <P as SSDVParameters>::DataLen
Length of the data field of an SSDV packet. Read more
Source§type CrcDataLen = <P as SSDVParameters>::CrcDataLen
type CrcDataLen = <P as SSDVParameters>::CrcDataLen
Length of the data taken into account for CRC-32 calculation. Read more
Source§type CallsignLen = <P as SSDVParameters>::CallsignLen
type CallsignLen = <P as SSDVParameters>::CallsignLen
Length of the callsign field. Read more
Source§fn set_fixed_fields(&mut self)
fn set_fixed_fields(&mut self)
Sets the fields of the packet that have fixed values. Read more
Source§fn callsign(&self) -> &GenericArray<u8, Self::CallsignLen>
fn callsign(&self) -> &GenericArray<u8, Self::CallsignLen>
Returns a reference to an array containing the callsign field.
Source§fn callsign_as_mut(&mut self) -> &mut GenericArray<u8, Self::CallsignLen>
fn callsign_as_mut(&mut self) -> &mut GenericArray<u8, Self::CallsignLen>
Returns a mutable reference to an array containing the callsign field.
Source§fn set_image_id(&mut self, image_id: u8)
fn set_image_id(&mut self, image_id: u8)
Sets the value of the image ID field.
Source§fn set_packet_id(&mut self, packet_id: u16)
fn set_packet_id(&mut self, packet_id: u16)
Sets the value of the packet ID field.
Source§fn set_height(&mut self, height: u8)
fn set_height(&mut self, height: u8)
Sets the value of the height field. Read more
Source§fn number_systematic_packets(&self) -> Option<u16>
fn number_systematic_packets(&self) -> Option<u16>
Returns the value of the number of systematic packets field. Read more
Source§fn set_number_systematic_packets(&mut self, number_systematic_packets: u16)
fn set_number_systematic_packets(&mut self, number_systematic_packets: u16)
Sets the value of the number of systematic packets field. Read more
Source§fn data(&self) -> &GenericArray<u8, Self::DataLen>
fn data(&self) -> &GenericArray<u8, Self::DataLen>
Returns a reference to an array containing the packet data field. Read more
Source§fn data_as_mut(&mut self) -> &mut GenericArray<u8, Self::DataLen>
fn data_as_mut(&mut self) -> &mut GenericArray<u8, Self::DataLen>
Returns a mutable reference to an array containing the packet data field. Read more
Source§fn crc32_data(&self) -> &GenericArray<u8, Self::CrcDataLen>
fn crc32_data(&self) -> &GenericArray<u8, Self::CrcDataLen>
Returns a reference to an array containing the part of the packet
covered by the CRC-32 calculation.
Source§fn compute_crc32<I, T>(data: I) -> u32
fn compute_crc32<I, T>(data: I) -> u32
Computes the CRC-32 of some data with the CRC-32 algorithm used by this
SSDV packet format. Read more
Source§fn is_fec_packet(&self) -> bool
fn is_fec_packet(&self) -> bool
Returns true if the packet has the FEC packet flag set.
Source§fn set_fec_packet(&mut self, fec_packet: bool)
fn set_fec_packet(&mut self, fec_packet: bool)
Sets the value of the FEC packet flag.
Source§fn computed_crc32(&self) -> u32
fn computed_crc32(&self) -> u32
Calculates the CRC-32 of the data in the packet. Read more
Source§fn crc32_is_valid(&self) -> bool
fn crc32_is_valid(&self) -> bool
Returns
true if the CRC-32 of the packet is correct.Source§fn update_crc32(&mut self)
fn update_crc32(&mut self)
Sets the CRC-32 field of the packet to the CRC computed from the data. Read more
impl<P: SSDVParameters> Copy for SSDVPacketArray<P>
impl<P: SSDVParameters> Eq for SSDVPacketArray<P>
Auto Trait Implementations§
impl<P> Freeze for SSDVPacketArray<P>
impl<P> RefUnwindSafe for SSDVPacketArray<P>
impl<P> Send for SSDVPacketArray<P>
impl<P> Sync for SSDVPacketArray<P>
impl<P> Unpin for SSDVPacketArray<P>
impl<P> UnwindSafe for SSDVPacketArray<P>
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