|
@ -7,7 +7,7 @@ pub mod packet; |
|
|
pub mod character;
|
|
|
pub mod character;
|
|
|
pub mod util;
|
|
|
pub mod util;
|
|
|
|
|
|
|
|
|
use std::io::Read;
|
|
|
|
|
|
|
|
|
use std::io::{Read, Seek};
|
|
|
#[derive(Debug, PartialEq)]
|
|
|
#[derive(Debug, PartialEq)]
|
|
|
pub enum PacketParseError {
|
|
|
pub enum PacketParseError {
|
|
|
NotEnoughBytes,
|
|
|
NotEnoughBytes,
|
|
@ -21,7 +21,7 @@ pub enum PacketParseError { |
|
|
|
|
|
|
|
|
trait PSOPacketData {
|
|
|
trait PSOPacketData {
|
|
|
//fn size(&self) -> usize;
|
|
|
//fn size(&self) -> usize;
|
|
|
fn from_bytes<R: Read>(cursor: &mut R) -> Result<Self, PacketParseError> where Self: Sized;
|
|
|
|
|
|
|
|
|
fn from_bytes<R: Read + Seek>(cursor: &mut R) -> Result<Self, PacketParseError> where Self: Sized;
|
|
|
fn as_bytes(&self) -> Vec<u8>;
|
|
|
fn as_bytes(&self) -> Vec<u8>;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|