Struct goblin::container::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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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§

fn size_with(container: &Ctx) -> usize

source§

impl SizeWith<Ctx> for Header

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

§

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

§

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

§

type Error = Error

source§

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

source§

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

§

type Error = Error

source§

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

source§

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

§

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

§

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

§

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

§

type Error = Error

source§

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

source§

impl TryIntoCtx<Ctx> for CompressionHeader

§

type Error = Error

source§

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

source§

impl TryIntoCtx<Ctx> for Dyn

§

type Error = Error

source§

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

source§

impl TryIntoCtx<Ctx> for Header

§

type Error = Error

source§

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

source§

impl TryIntoCtx<Ctx> for Nlist

§

type Error = Error

source§

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

source§

impl TryIntoCtx<Ctx> for ProgramHeader

§

type Error = Error

source§

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

source§

impl TryIntoCtx<Ctx> for Section

§

type Error = Error

source§

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

source§

impl TryIntoCtx<Ctx> for SectionHeader

§

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>

§

type Error = Error

source§

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

source§

impl TryIntoCtx<Ctx> for Sym

§

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> 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,

§

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>,

§

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>,

§

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.