pub struct RawFile {
pub name: RawStr,
pub data: Bytes,
/* private fields */
}Expand description
A file UnityPy keeps as a reader.
Fields§
§name: RawStrThe name it was loaded under.
data: BytesIts bytes (a slice of the parent’s buffer for an entry).
Implementations§
Source§impl RawFile
impl RawFile
Sourcepub fn new(
name: RawStr,
data: Bytes,
ty: FileType,
meter: &Arc<Meter>,
) -> Result<Arc<Self>, ChargeError>
pub fn new( name: RawStr, data: Bytes, ty: FileType, meter: &Arc<Meter>, ) -> Result<Arc<Self>, ChargeError>
A raw file of data under name, which check_file_type called
ty, its allocation charged to meter first (data is a slice of a
buffer already charged, or the caller’s). A memory reader, as UnityPy
keeps bytes and every entry of a container.
Sourcepub fn with_reader(
name: RawStr,
data: Bytes,
ty: FileType,
meter: &Arc<Meter>,
reader: ReaderKind,
) -> Result<Arc<Self>, ChargeError>
pub fn with_reader( name: RawStr, data: Bytes, ty: FileType, meter: &Arc<Meter>, reader: ReaderKind, ) -> Result<Arc<Self>, ChargeError>
Self::new as the reader reader (ReaderKind::Stream for a
top-level file loaded from a path).
Sourcepub fn reader_kind(&self) -> ReaderKind
pub fn reader_kind(&self) -> ReaderKind
The reader UnityPy keeps it as, whose rules a resource read from it
follows (ResourceReader._get_resource_data).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RawFile
impl !RefUnwindSafe for RawFile
impl !UnwindSafe for RawFile
impl Forget for RawFile
impl Move for RawFile
impl Send for RawFile
impl Sync for RawFile
impl Unpin for RawFile
impl UnsafeUnpin for RawFile
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