[][src]Struct assembly_data::fdb::ro::buffer::Buffer

pub struct Buffer<'a>(_);

Wrapper around a immutable reference to a byte slice

Implementations

impl<'a> Buffer<'a>[src]

pub fn new(buf: &'a [u8]) -> Self[src]

Creates a new instance.

pub fn as_bytes(self) -> &'a [u8][src]

Returns the contained byte slice

pub fn try_cast<T: MinimallyAligned>(
    self,
    offset: u32
) -> Result<&'a T, CastError>
[src]

Try to cast to T

pub fn try_cast_slice<T: MinimallyAligned>(
    self,
    offset: u32,
    len: u32
) -> Result<&'a [T], CastError>
[src]

Try to cast to T

pub fn get_at<T>(self, addr: usize) -> Res<&'a T>[src]

Get a reference to a type at the given address of this buffer

This functions checks whether the offset and alignment is valid

pub fn get_slice_at<T>(self, addr: usize, count: usize) -> Res<&'a [T]>[src]

Get a reference to a slice at the given address of this buffer

This functions checks whether the offset and alignment is valid

pub fn header_ref(self) -> Res<&'a FDBHeader>[src]

Get the database header

pub fn table_headers(self, header: &'a FDBHeader) -> Res<&'a [FDBTableHeader]>[src]

Get the table slice

pub fn get_len_at(self, start: usize, len: usize) -> Res<&'a [u8]>[src]

Get a subslice a the given offset of the given length

pub fn string(self, addr: u32) -> Res<&'a Latin1Str>[src]

Get a buffer as a latin1 string

pub fn header(self) -> Res<FDBHeader>[src]

Get the header of the file.

pub fn table_def_header(&self, addr: u32) -> Res<FDBTableDefHeader>[src]

Get the table definition header at the given addr.

pub fn table_data_header(self, addr: u32) -> Res<FDBTableDataHeader>[src]

Get the table data header at the given addr.

pub fn row_header_list_entry(self, addr: u32) -> Res<FDBRowHeaderListEntry>[src]

Get the FDBRowHeader list entry at the given addr.

pub fn row_header(self, addr: u32) -> Res<FDBRowHeader>[src]

Get the FDBRowHeader at the given addr.

Trait Implementations

impl<'a> Clone for Buffer<'a>[src]

impl<'a> Copy for Buffer<'a>[src]

impl<'a> Debug for Buffer<'a>[src]

impl<'a> Deref for Buffer<'a>[src]

type Target = [u8]

The resulting type after dereferencing.

Auto Trait Implementations

impl<'a> RefUnwindSafe for Buffer<'a>[src]

impl<'a> Send for Buffer<'a>[src]

impl<'a> Sync for Buffer<'a>[src]

impl<'a> Unpin for Buffer<'a>[src]

impl<'a> UnwindSafe for Buffer<'a>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.