Skip to main content

Parent

Struct Parent 

Source
pub struct Parent {
    pub name: RawStr,
    pub kind: ParentKind,
    pub depth: u32,
    pub pinned: u64,
}
Expand description

What a child knows of its container. A file loaded at top level has none (parent: None): UnityPy makes the Environment that loaded it its parent (environment.py:154), which is the container PPtr.deref scans (plan section 3.13, rule 4). The input’s meter travels separately, as every file’s File::meter, top-level ones included.

Fields§

§name: RawStr

The container’s name.

§kind: ParentKind

The container’s kind.

§depth: u32

How deep the child is: 1 for an entry of a top-level container. A container at crate::limits::Limits::max_container_depth refuses to parse an entry that is itself a container (LimitKind::ContainerDepth).

§pinned: u64

The length of the buffer the child’s bytes are a slice of, which any slice of them keeps alive: the container’s decoded run that holds them, or, for stored blocks, the buffer of the container’s own bytes (its own pinned). Never less than the child’s own length, which is what a container that does not know it gives. A value read from the child copies its slices out when they would keep much more than themselves alive (crate::pin; plan section 8, R3).

Trait Implementations§

Source§

impl Clone for Parent

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 Parent

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Freeze for Parent

§

impl !RefUnwindSafe for Parent

§

impl !UnwindSafe for Parent

§

impl Forget for Parent

§

impl Move for Parent

§

impl Send for Parent

§

impl Sync for Parent

§

impl Unpin for Parent

§

impl UnsafeUnpin for Parent

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> Same for T

Source§

type Output = T

Should always be Self
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.