#[repr(C, packed(1))]pub struct DataPacket {
pub blocks: [Block; 12],
pub timestamp: u32,
pub return_mode: ReturnMode,
pub product_id: ProductID,
}Expand description
Represents the data packet from Velodyne sensor.
Fields§
§blocks: [Block; 12]Sensor data.
timestamp: u32Timestamp in microseconds.
return_mode: ReturnModeIndicates single return mode or dual return mode.
product_id: ProductIDSensor model.
Implementations§
Source§impl DataPacket
impl DataPacket
Sourcepub fn from_pcap(packet: &Packet<'_>) -> Result<Self>
pub fn from_pcap(packet: &Packet<'_>) -> Result<Self>
Construct packet from pcap::Packet.
Sourcepub fn from_buffer(buffer: [u8; 1206]) -> Self
pub fn from_buffer(buffer: [u8; 1206]) -> Self
Construct packet from binary buffer.
Sourcepub fn from_slice(buffer: &[u8]) -> Result<&Self>
pub fn from_slice(buffer: &[u8]) -> Result<&Self>
Construct packet from slice of bytes. Fail if the slice size is not correct.
Sourcepub fn datetime(&self) -> NaiveDateTime
pub fn datetime(&self) -> NaiveDateTime
Construct NaiveDateTime from packet timestamp.
pub fn time(&self) -> Time
Trait Implementations§
Source§impl Clone for DataPacket
impl Clone for DataPacket
Source§fn clone(&self) -> DataPacket
fn clone(&self) -> DataPacket
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DataPacket
impl Debug for DataPacket
Source§impl Hash for DataPacket
impl Hash for DataPacket
Source§impl PartialEq for DataPacket
impl PartialEq for DataPacket
impl Copy for DataPacket
impl Eq for DataPacket
impl StructuralPartialEq for DataPacket
Auto Trait Implementations§
impl Freeze for DataPacket
impl RefUnwindSafe for DataPacket
impl Send for DataPacket
impl Sync for DataPacket
impl Unpin for DataPacket
impl UnwindSafe for DataPacket
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more