Struct calypso_filety::ccff::Section
source · [−]pub struct Section { /* private fields */ }
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.
Implementations
sourceimpl 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(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
pub fn get_data(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
Get a reference to the data of the section.
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.
Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcepub fn equivalent(&self, key: &K) -> bool
pub fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more