Skip to main content

RelocationBuilder

Struct RelocationBuilder 

Source
pub struct RelocationBuilder { /* private fields */ }
Expand description

A builder for the bitfield.

Implementations§

Source§

impl RelocationBuilder

Source

pub fn new() -> Self

Creates a new bitfield builder instance.

Source

pub fn new_without_defaults() -> Self

Creates a new bitfield builder instance without setting any default values.

Source

pub fn with_offset(self, bits: u16) -> Self

Sets builder bits 0..=15.

Source

pub fn checked_with_offset(self, bits: u16) -> Result<Self, &'static str>

Sets builder bits 0..=15.. Returns an error if the value is too big to fit within the field bits.

Source

pub fn with_encoding(self, bits: RelocationEncoding) -> Self

Sets builder bits 16..=22.

Source

pub fn checked_with_encoding( self, bits: RelocationEncoding, ) -> Result<Self, &'static str>

Sets builder bits 16..=22.. Returns an error if the value is too big to fit within the field bits.

Source

pub fn with_relative(self, bits: bool) -> Self

Sets builder bit 23.

Source

pub fn checked_with_relative(self, bits: bool) -> Result<Self, &'static str>

Sets builder bit 23.. Returns an error if the value is too big to fit within the field bit.

Source

pub fn with_size(self, bits: u8) -> Self

Sets builder bits 24..=31.

Source

pub fn checked_with_size(self, bits: u8) -> Result<Self, &'static str>

Sets builder bits 24..=31.. Returns an error if the value is too big to fit within the field bits.

Source

pub fn with_addend(self, bits: i16) -> Self

Sets builder bits 32..=43.

Source

pub fn checked_with_addend(self, bits: i16) -> Result<Self, &'static str>

Sets builder bits 32..=43.. Returns an error if the value is too big to fit within the field bits.

Source

pub fn with_patch_kind(self, bits: PatchKind) -> Self

Sets builder bits 44..=47.

Source

pub fn checked_with_patch_kind( self, bits: PatchKind, ) -> Result<Self, &'static str>

Sets builder bits 44..=47.. Returns an error if the value is too big to fit within the field bits.

Source

pub fn with_patch_id(self, bits: u16) -> Self

Sets builder bits 48..=63.

Source

pub fn checked_with_patch_id(self, bits: u16) -> Result<Self, &'static str>

Sets builder bits 48..=63.. Returns an error if the value is too big to fit within the field bits.

Source

pub fn build(self) -> Relocation

Builds a bitfield instance from the builder.

Trait Implementations§

Source§

impl Default for RelocationBuilder

Source§

fn default() -> Self

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

Auto Trait Implementations§

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