hide packets to reduce api surface for new users

This commit is contained in:
Vinzenz Schroeter 2024-10-10 23:37:04 +02:00
parent 26bace8990
commit 78b5d1180b
6 changed files with 39 additions and 36 deletions

View file

@ -7,7 +7,7 @@ use std::ptr::null_mut;
use crate::SPCommand;
/// The raw packet
pub struct SPPacket(pub(crate) servicepoint::Packet);
pub struct SPPacket(pub(crate) servicepoint::packet::Packet);
/// Turns a `SPCommand` into a `SPPacket`.
/// The `SPCommand` gets consumed.
@ -49,7 +49,7 @@ pub unsafe extern "C" fn sp_packet_try_load(
length: usize,
) -> *mut SPPacket {
let data = std::slice::from_raw_parts(data, length);
match servicepoint::Packet::try_from(data) {
match servicepoint::packet::Packet::try_from(data) {
Err(_) => null_mut(),
Ok(packet) => Box::into_raw(Box::new(SPPacket(packet))),
}