[−][src]Struct sciter::host::Archive
Sciter compressed archive.
An archive is produced by packfolder
(from SDK) that creates a blob with compressed resources.
It allows to use the same resource pack uniformly across different platforms.
For example, app resource files (HTML/CSS/scripts) can be stored in an assets
folder
that can be packed into a single archive by calling packfolder.exe assets target/assets.rc -binary
.
And later can be accessed via the Archive API:
ⓘThis example is not tested
let archived = include_bytes!("target/assets.rc"); let assets = sciter::host::Archive::open(archived).expect("Unable to load archive."); // access `assets/index.htm` let html_data = assets.get("index.htm").unwrap();
Methods
impl Archive
[src]
pub fn open(archived: &[u8]) -> Result<Self>
[src]
Open archive blob.
pub fn get(&self, path: &str) -> Option<&[u8]>
[src]
Get an archive item.
Given a path, returns a reference to the contents of an archived item.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Archive
impl !Send for Archive
impl !Sync for Archive
impl Unpin for Archive
impl UnwindSafe for Archive
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,