Skip to main content

Blob

Struct Blob 

Source
pub struct Blob {
    bytes: Vec<u8>,
    pointers: Vec<(usize, Target)>,
}
Expand description

The bytes of one piece of data, and the pointers in it, which the linker fills in.

Fields§

§bytes: Vec<u8>§pointers: Vec<(usize, Target)>

Implementations§

Source§

impl Blob

Source

pub fn zeroed(size: usize) -> Self

size zero bytes, which read as empty slices, null pointers and zeros.

Source

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

Source

pub fn put_u8(&mut self, offset: usize, value: u8)

Source

pub fn put_u32(&mut self, offset: usize, value: u32)

Source

pub fn put_i64(&mut self, offset: usize, value: i64)

Source

pub fn put_f32(&mut self, offset: usize, value: f32)

Source

pub fn put_usize(&mut self, offset: usize, value: usize)

Source

pub fn put_pointer(&mut self, offset: usize, target: Target)

Source

pub fn put_slice(&mut self, offset: usize, items: Option<Target>, len: usize)

A nifty_rt::Slice or Str at offset: len items starting at items, or an empty one when there are none.

Source

fn put(&mut self, offset: usize, value: &[u8])

§Panics

When the value doesn’t fit inside the blob, which is a bug in the caller’s layout.

Trait Implementations§

Source§

impl Debug for Blob

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Blob

§

impl RefUnwindSafe for Blob

§

impl Send for Blob

§

impl Sync for Blob

§

impl Unpin for Blob

§

impl UnsafeUnpin for Blob

§

impl UnwindSafe for Blob

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> AutoreleaseSafe for T
where T: ?Sized,

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