pub struct WebFile {
pub signature: String,
pub compression: WebFileCompression,
pub files: Vec<BundleFileInfo>,
/* private fields */
}Expand description
A Unity WebFile that can contain other files
Fields§
§signature: StringSignature (e.g., “UnityWebData1.0”)
compression: WebFileCompressionCompression type used
files: Vec<BundleFileInfo>Files contained in this WebFile
Implementations§
Source§impl WebFile
impl WebFile
Sourcepub fn from_bytes(data: Vec<u8>) -> Result<WebFile, BinaryError>
pub fn from_bytes(data: Vec<u8>) -> Result<WebFile, BinaryError>
Parse a WebFile from binary data
Sourcepub fn files(&self) -> &[BundleFileInfo]
pub fn files(&self) -> &[BundleFileInfo]
Get the files contained in this WebFile
pub fn data_arc(&self) -> Arc<[u8]>
Sourcepub fn extract_file(&self, name: &str) -> Result<Vec<u8>, BinaryError>
pub fn extract_file(&self, name: &str) -> Result<Vec<u8>, BinaryError>
Extract a specific file by name
pub fn extract_file_slice(&self, name: &str) -> Result<&[u8], BinaryError>
pub fn extract_file_view(&self, name: &str) -> Result<DataView, BinaryError>
Sourcepub fn parse_bundles(&self) -> Result<Vec<AssetBundle>, BinaryError>
pub fn parse_bundles(&self) -> Result<Vec<AssetBundle>, BinaryError>
Try to parse contained files as AssetBundles
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WebFile
impl RefUnwindSafe for WebFile
impl Send for WebFile
impl Sync for WebFile
impl Unpin for WebFile
impl UnwindSafe for WebFile
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more