goblin::container

Struct Ctx

Source
pub struct Ctx {
    pub container: Container,
    pub le: Endian,
}
Expand description

A binary parsing context, including the container size and underlying byte endianness

Fields§

§container: Container§le: Endian

Implementations§

Source§

impl Ctx

Source

pub fn is_big(self) -> bool

Whether this binary container context is “big” or not

Source

pub fn is_little_endian(self) -> bool

Whether this binary container context is little endian or not

Source

pub fn new(container: Container, le: Endian) -> Self

Create a new binary container context

Source

pub fn size(self) -> usize

Return a dubious pointer/address byte size for the container

Trait Implementations§

Source§

impl Clone for Ctx

Source§

fn clone(&self) -> Ctx

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Ctx

Source§

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

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

impl Default for Ctx

Source§

fn default() -> Self

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

impl From<Container> for Ctx

Source§

fn from(container: Container) -> Self

Converts to this type from the input type.
Source§

impl From<Endian> for Ctx

Source§

fn from(le: Endian) -> Self

Converts to this type from the input type.
Source§

impl IntoCtx<Ctx> for CompressionHeader

Source§

fn into_ctx(self, bytes: &mut [u8], _: Ctx)

Source§

impl IntoCtx<Ctx> for Header

Source§

fn into_ctx(self, bytes: &mut [u8], ctx: Ctx)

Source§

impl IntoCtx<Ctx> for Header

Source§

fn into_ctx(self, bytes: &mut [u8], ctx: Ctx)

Source§

impl IntoCtx<Ctx> for Nlist

Source§

fn into_ctx(self, bytes: &mut [u8], ctx: Ctx)

Source§

impl IntoCtx<Ctx> for Section

Source§

fn into_ctx(self, bytes: &mut [u8], ctx: Ctx)

Source§

impl IntoCtx<Ctx> for SectionHeader

Source§

fn into_ctx(self, bytes: &mut [u8], _: Ctx)

Source§

impl<'a> IntoCtx<Ctx> for Segment<'a>

Source§

fn into_ctx(self, bytes: &mut [u8], ctx: Ctx)

Source§

impl IntoCtx<Ctx> for Sym

Source§

fn into_ctx(self, bytes: &mut [u8], _: Ctx)

Source§

impl PartialEq for Ctx

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl SizeWith<Ctx> for CompressionHeader

Source§

impl SizeWith<Ctx> for Dyn

Source§

impl SizeWith<Ctx> for Header

Source§

impl SizeWith<Ctx> for Header

Source§

fn size_with(container: &Ctx) -> usize

Source§

impl SizeWith<Ctx> for Nlist

Source§

impl SizeWith<Ctx> for ProgramHeader

Source§

impl SizeWith<Ctx> for Section

Source§

impl SizeWith<Ctx> for SectionHeader

Source§

impl<'a> SizeWith<Ctx> for Segment<'a>

Source§

impl SizeWith<Ctx> for Sym

Source§

impl<'a> TryFromCtx<'a, Ctx> for CompressionHeader

Source§

type Error = Error

Source§

fn try_from_ctx(bytes: &'a [u8], _: Ctx) -> Result<(Self, usize), Self::Error>

Source§

impl<'a> TryFromCtx<'a, Ctx> for Dyn

Source§

type Error = Error

Source§

fn try_from_ctx(bytes: &'a [u8], _: Ctx) -> Result<(Self, usize), Self::Error>

Source§

impl<'a> TryFromCtx<'a, Ctx> for Header

Source§

type Error = Error

Source§

fn try_from_ctx(bytes: &'a [u8], _: Ctx) -> Result<(Self, usize)>

Source§

impl<'a> TryFromCtx<'a, Ctx> for Nlist

Source§

type Error = Error

Source§

fn try_from_ctx(bytes: &'a [u8], _: Ctx) -> Result<(Self, usize)>

Source§

impl<'a> TryFromCtx<'a, Ctx> for ProgramHeader

Source§

type Error = Error

Source§

fn try_from_ctx(bytes: &'a [u8], _: Ctx) -> Result<(Self, usize), Self::Error>

Source§

impl<'a> TryFromCtx<'a, Ctx> for Section

Source§

type Error = Error

Source§

fn try_from_ctx(bytes: &'a [u8], ctx: Ctx) -> Result<(Self, usize), Self::Error>

Source§

impl<'a> TryFromCtx<'a, Ctx> for SectionHeader

Source§

type Error = Error

Source§

fn try_from_ctx(bytes: &'a [u8], _: Ctx) -> Result<(Self, usize), Self::Error>

Source§

impl<'a> TryFromCtx<'a, Ctx> for Sym

Source§

type Error = Error

Source§

fn try_from_ctx(bytes: &'a [u8], _: Ctx) -> Result<(Self, usize), Self::Error>

Source§

impl TryIntoCtx<Ctx> for CompressionHeader

Source§

type Error = Error

Source§

fn try_into_ctx(self, bytes: &mut [u8], _: Ctx) -> Result<usize, Self::Error>

Source§

impl TryIntoCtx<Ctx> for Dyn

Source§

type Error = Error

Source§

fn try_into_ctx(self, bytes: &mut [u8], _: Ctx) -> Result<usize, Self::Error>

Source§

impl TryIntoCtx<Ctx> for Header

Source§

type Error = Error

Source§

fn try_into_ctx(self, bytes: &mut [u8], ctx: Ctx) -> Result<usize>

Source§

impl TryIntoCtx<Ctx> for Nlist

Source§

type Error = Error

Source§

fn try_into_ctx(self, bytes: &mut [u8], _: Ctx) -> Result<usize, Self::Error>

Source§

impl TryIntoCtx<Ctx> for ProgramHeader

Source§

type Error = Error

Source§

fn try_into_ctx(self, bytes: &mut [u8], _: Ctx) -> Result<usize, Self::Error>

Source§

impl TryIntoCtx<Ctx> for Section

Source§

type Error = Error

Source§

fn try_into_ctx(self, bytes: &mut [u8], ctx: Ctx) -> Result<usize, Self::Error>

Source§

impl TryIntoCtx<Ctx> for SectionHeader

Source§

type Error = Error

Source§

fn try_into_ctx(self, bytes: &mut [u8], _: Ctx) -> Result<usize, Self::Error>

Source§

impl<'a> TryIntoCtx<Ctx> for Segment<'a>

Source§

type Error = Error

Source§

fn try_into_ctx(self, bytes: &mut [u8], ctx: Ctx) -> Result<usize, Self::Error>

Source§

impl TryIntoCtx<Ctx> for Sym

Source§

type Error = Error

Source§

fn try_into_ctx(self, bytes: &mut [u8], _: Ctx) -> Result<usize, Self::Error>

Source§

impl Copy for Ctx

Source§

impl StructuralPartialEq for Ctx

Auto Trait Implementations§

§

impl Freeze for Ctx

§

impl RefUnwindSafe for Ctx

§

impl Send for Ctx

§

impl Sync for Ctx

§

impl Unpin for Ctx

§

impl UnwindSafe for Ctx

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, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.