#![allow(unknown_lints)]
#![forbid(unsafe_code)]
#![allow(clippy::needless_return)]
#![allow(clippy::nonminimal_bool)]
#![allow(clippy::tabs_in_doc_comments)]
#![allow(clippy::new_without_default)]
#![allow(clippy::partialeq_to_none)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#[cfg(test)]
mod test;
macro_rules! tri {
($e:expr) => {
match $e {
Ok(val) => val,
Err(err) => return Err(err.into()),
}
};
}
mod crc;
pub mod reading;
pub mod writing;
pub use crate::writing::{PacketWriter, PacketWriteEndInfo};
pub use crate::reading::{PacketReader, OggReadError, PageParsingOptions};
pub struct Packet {
pub data :Vec<u8>,
first_packet_pg :bool,
first_packet_stream :bool,
last_packet_pg :bool,
last_packet_stream :bool,
absgp_page :u64,
stream_serial :u32,
checksum_page :u32,
}
impl Packet {
pub fn first_in_page(&self) -> bool {
self.first_packet_pg
}
pub fn first_in_stream(&self) -> bool {
self.first_packet_stream
}
pub fn last_in_page(&self) -> bool {
self.last_packet_pg
}
pub fn last_in_stream(&self) -> bool {
self.last_packet_stream
}
pub fn absgp_page(&self) -> u64 {
self.absgp_page
}
pub fn stream_serial(&self) -> u32 {
self.stream_serial
}
pub fn checksum_page(&self) -> u32 {
self.checksum_page
}
}