pub struct SectionFile { /* private fields */ }Expand description
In-memory TSDuck section-file container.
SectionFile is !Send + !Sync. Its native owner is dropped before the
retained DuckContext, preserving the native borrowed-context lifetime.
Implementations§
Source§impl SectionFile
impl SectionFile
Sourcepub fn new(duck: Rc<DuckContext>) -> Result<Self>
pub fn new(duck: Rc<DuckContext>) -> Result<Self>
Creates an empty section-file container borrowing duck.
Sourcepub fn duck_context(&self) -> &Rc<DuckContext>
pub fn duck_context(&self) -> &Rc<DuckContext>
Returns the retained context.
Sourcepub fn binary_size(&self) -> Result<usize>
pub fn binary_size(&self) -> Result<usize>
Returns serialized binary size in bytes.
Sourcepub fn sections_count(&self) -> Result<usize>
pub fn sections_count(&self) -> Result<usize>
Returns the number of sections.
Sourcepub fn tables_count(&self) -> Result<usize>
pub fn tables_count(&self) -> Result<usize>
Returns the number of tables.
Sourcepub fn set_crc_validation(&mut self, mode: CrcValidation) -> Result<()>
pub fn set_crc_validation(&mut self, mode: CrcValidation) -> Result<()>
Sets CRC handling for subsequent binary loads.
Sourcepub fn load_binary_buffer(&mut self, data: &[u8]) -> Result<()>
pub fn load_binary_buffer(&mut self, data: &[u8]) -> Result<()>
Loads binary sections from memory.
Sourcepub fn load_binary(&mut self, path: &Path) -> Result<()>
pub fn load_binary(&mut self, path: &Path) -> Result<()>
Loads binary sections from a filesystem path.
Sourcepub fn save_binary(&self, path: &Path) -> Result<()>
pub fn save_binary(&self, path: &Path) -> Result<()>
Saves binary sections to a filesystem path.
Auto Trait Implementations§
impl !RefUnwindSafe for SectionFile
impl !Send for SectionFile
impl !Sync for SectionFile
impl !UnwindSafe for SectionFile
impl Freeze for SectionFile
impl Unpin for SectionFile
impl UnsafeUnpin for SectionFile
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