pub struct Container { /* private fields */ }Expand description
An ASiC-E container held in memory.
Implementations§
Source§impl Container
impl Container
Sourcepub fn data_files(&self) -> &[DataFile]
pub fn data_files(&self) -> &[DataFile]
Data files in the container.
Sourcepub fn signatures(&self) -> &[SignatureFile]
pub fn signatures(&self) -> &[SignatureFile]
Signature documents in the container.
Sourcepub fn add_file(
&mut self,
name: impl Into<String>,
mime_type: impl Into<String>,
content: Vec<u8>,
) -> Result<()>
pub fn add_file( &mut self, name: impl Into<String>, mime_type: impl Into<String>, content: Vec<u8>, ) -> Result<()>
Sourcepub fn add_signature_xml(&mut self, xml: String) -> &SignatureFile
pub fn add_signature_xml(&mut self, xml: String) -> &SignatureFile
Append a signature document.
The entry name is assigned automatically as META-INF/signaturesN.xml,
using the first free index N.
Sourcepub fn open<R: Read + Seek>(reader: R) -> Result<Self>
pub fn open<R: Read + Seek>(reader: R) -> Result<Self>
Open a container from any seekable reader, using default OpenOptions.
Sourcepub fn open_with<R: Read + Seek>(reader: R, opts: &OpenOptions) -> Result<Self>
pub fn open_with<R: Read + Seek>(reader: R, opts: &OpenOptions) -> Result<Self>
Open a container from any seekable reader under an explicit policy.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self>
pub fn from_bytes(bytes: &[u8]) -> Result<Self>
Open a container from a byte buffer.
Sourcepub fn from_bytes_with(bytes: &[u8], opts: &OpenOptions) -> Result<Self>
pub fn from_bytes_with(bytes: &[u8], opts: &OpenOptions) -> Result<Self>
Open a container from a byte buffer under an explicit policy.
Sourcepub fn open_file_with(
path: impl AsRef<Path>,
opts: &OpenOptions,
) -> Result<Self>
pub fn open_file_with( path: impl AsRef<Path>, opts: &OpenOptions, ) -> Result<Self>
Open a container file from disk under an explicit policy.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Container
impl RefUnwindSafe for Container
impl Send for Container
impl Sync for Container
impl Unpin for Container
impl UnsafeUnpin for Container
impl UnwindSafe for Container
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