Struct calypso_filety::ccff::Section
source · Expand description
The section is the actual container of data with in a CCFF container file.
It stores some basic metadata: a section type and
flags, both of which are user-defined. The data can
be accessed and modified via the get_data
,
get_data_mut
, and set_data
functions.
Fields§
§stype: u8
§flags: u32
§offset: Option<u32>
§data: Vec<u8>
Implementations§
source§impl Section
impl Section
sourcepub fn new(stype: u8, flags: u32) -> Self
pub fn new(stype: u8, flags: u32) -> Self
Create a section. The section type (stype
) or flags may be any
arbitrary user-defined value.
sourcepub fn set_type(&mut self, stype: u8)
pub fn set_type(&mut self, stype: u8)
Set the type of the section. This may be any arbitrary user-defined value.
sourcepub fn set_flags(&mut self, flags: u32)
pub fn set_flags(&mut self, flags: u32)
Set the flags of the section. This may be any arbitrary user-defined value.
sourcepub fn set_data(&mut self, data: Vec<u8>) -> Vec<u8>
pub fn set_data(&mut self, data: Vec<u8>) -> Vec<u8>
Set the data of the section. This may be any arbitrary user-defined data. The previous data will be returned.
sourcepub fn get_data_mut(&mut self) -> &mut Vec<u8>
pub fn get_data_mut(&mut self) -> &mut Vec<u8>
Get a mutable reference to the data of the section.
sourcepub fn get_offset(&self) -> Option<u32>
pub fn get_offset(&self) -> Option<u32>
Get the offset of the data in the container file. This is only present when loading from a file and cannot be set manually in order to prevent errors.
fn sizeof(name: &str) -> usize
Trait Implementations§
source§impl PartialEq<Section> for Section
impl PartialEq<Section> for Section
impl Eq for Section
impl StructuralEq for Section
impl StructuralPartialEq for Section
Auto Trait Implementations§
impl RefUnwindSafe for Section
impl Send for Section
impl Sync for Section
impl Unpin for Section
impl UnwindSafe for Section
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.