pub struct FrameHeader { /* private fields */ }
Implementations§
Source§impl FrameHeader
impl FrameHeader
pub fn new( encoding: EncodingFlag, sample_size: u16, sample_rate: u32, channels: u8, bits_per_sample: u8, endianness: Endianness, id: Option<u64>, ) -> Result<Self, String>
pub fn encode<W: Write>(&self, writer: &mut W) -> Result<()>
pub fn decode<R: Read>(reader: &mut R) -> Result<Self>
pub fn validate_header(header_bytes: &[u8]) -> Result<bool, String>
pub fn encoding(&self) -> &EncodingFlag
pub fn sample_size(&self) -> u16
pub fn sample_rate(&self) -> u32
pub fn channels(&self) -> u8
pub fn bits_per_sample(&self) -> u8
pub fn endianness(&self) -> &Endianness
pub fn id(&self) -> Option<u64>
pub fn size(&self) -> usize
pub fn patch_bits_per_sample( header_bytes: &mut [u8], bits: u8, ) -> Result<(), String>
pub fn patch_sample_size( header_bytes: &mut [u8], new_sample_size: u16, ) -> Result<(), String>
pub fn patch_encoding( header_bytes: &mut [u8], encoding: EncodingFlag, ) -> Result<(), String>
pub fn patch_sample_rate( header_bytes: &mut [u8], sample_rate: u32, ) -> Result<(), String>
pub fn patch_channels( header_bytes: &mut [u8], channels: u8, ) -> Result<(), String>
Sourcepub fn patch_id(header_bytes: &mut [u8], id: Option<u64>) -> Result<(), String>
pub fn patch_id(header_bytes: &mut [u8], id: Option<u64>) -> Result<(), String>
Patch the ID present flag and optionally the ID itself in an existing header
pub fn extract_sample_count(header_bytes: &[u8]) -> Result<u16, String>
Sourcepub fn extract_id(header_bytes: &[u8]) -> Result<Option<u64>, String>
pub fn extract_id(header_bytes: &[u8]) -> Result<Option<u64>, String>
Extract just the ID if present from a header without fully decoding it
pub fn extract_encoding(header_bytes: &[u8]) -> Result<EncodingFlag, String>
Trait Implementations§
Source§impl Debug for FrameHeader
impl Debug for FrameHeader
Source§impl<'de> Deserialize<'de> for FrameHeader
impl<'de> Deserialize<'de> for FrameHeader
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FrameHeader
impl RefUnwindSafe for FrameHeader
impl Send for FrameHeader
impl Sync for FrameHeader
impl Unpin for FrameHeader
impl UnwindSafe for FrameHeader
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