Skip to main content

TreeCase

Struct TreeCase 

Source
pub struct TreeCase {
    pub flags: u8,
    pub start: i8,
    pub rows: Vec<Row>,
    pub refs: Vec<RefType>,
    pub data: Vec<u8>,
}
Expand description

A tree, the ref types it may reach, and the bytes of one value.

Layout: flags (a byte of TreeCase’s bits), start (an i8), the rows, the count of ref types (a byte) and each ref type, then the value’s bytes, which run to the end. Rows are a u16 count (little-endian) and each row’s level (a byte), meta flag (an i32, little-endian), type and name; a string is a byte of length and its bytes. A ref type is its class, namespace and assembly, a byte whose low bit says a tree follows, and that tree’s rows.

Fields§

§flags: u8

The bits below.

§start: i8

Where the pure-Python reader starts, from the start of the data.

§rows: Vec<Row>

The value’s tree.

§refs: Vec<RefType>

The file’s ref types, in order.

§data: Vec<u8>

The value’s bytes.

Implementations§

Source§

impl TreeCase

Source

pub const BIG_ENDIAN: u8 = 1

The data is big-endian.

Source

pub const REFS_ABSENT: u8 = 2

The file has no ref_types (format below 20), whatever refs holds.

Source

pub const REFS_NO_FILE: u8 = 4

There is no file at all, whatever refs holds (wins over Self::REFS_ABSENT).

Source

pub const STREAM: u8 = 8

The pure-Python reader reads by the stream reader’s rules (a file loaded from a path).

Source

pub const LOSSLESS: u8 = 16

Float32 signalling NaNs keep their bits.

Source

pub const PYTHON: u8 = 32

write_after_read reads with the pure-Python reader, not UnityPyBoost’s.

Source

pub const SMALL_MEMORY: u8 = 64

The run bounds memory at the fuzz crate’s small bound (SMALL_MEMORY in fuzz/src/lib.rs), which a read of many small values reaches before the work bound, not at the large one, which no value read reaches. Without it the code that grows a charged buffer at the memory bound never runs in the value targets.

Source

pub const BYTES_IO: u8 = 128

With Self::STREAM, the stream reader is backed by io.BytesIO, where a negative read size reads to the end.

Source

pub fn has(&self, bit: u8) -> bool

Whether flags holds bit.

Source

pub fn encode(&self) -> Vec<u8> ⓘ

The case’s bytes.

Source

pub fn decode(input: &[u8]) -> Self

The case input holds; what it does not reach is empty.

Trait Implementations§

Source§

impl Clone for TreeCase

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TreeCase

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TreeCase

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for TreeCase

Source§

impl PartialEq for TreeCase

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for TreeCase

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.