pub struct RelocationBuilder { /* private fields */ }Expand description
A builder for the bitfield.
Implementations§
Source§impl RelocationBuilder
impl RelocationBuilder
Sourcepub fn new_without_defaults() -> Self
pub fn new_without_defaults() -> Self
Creates a new bitfield builder instance without setting any default values.
Sourcepub fn with_offset(self, bits: u16) -> Self
pub fn with_offset(self, bits: u16) -> Self
Sets builder bits 0..=15.
Sourcepub fn checked_with_offset(self, bits: u16) -> Result<Self, &'static str>
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.
Sourcepub fn with_encoding(self, bits: RelocationEncoding) -> Self
pub fn with_encoding(self, bits: RelocationEncoding) -> Self
Sets builder bits 16..=22.
Sourcepub fn checked_with_encoding(
self,
bits: RelocationEncoding,
) -> Result<Self, &'static str>
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.
Sourcepub fn with_relative(self, bits: bool) -> Self
pub fn with_relative(self, bits: bool) -> Self
Sets builder bit 23.
Sourcepub fn checked_with_relative(self, bits: bool) -> Result<Self, &'static str>
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.
Sourcepub fn checked_with_size(self, bits: u8) -> Result<Self, &'static str>
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.
Sourcepub fn with_addend(self, bits: i16) -> Self
pub fn with_addend(self, bits: i16) -> Self
Sets builder bits 32..=43.
Sourcepub fn checked_with_addend(self, bits: i16) -> Result<Self, &'static str>
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.
Sourcepub fn with_patch_kind(self, bits: PatchKind) -> Self
pub fn with_patch_kind(self, bits: PatchKind) -> Self
Sets builder bits 44..=47.
Sourcepub fn checked_with_patch_kind(
self,
bits: PatchKind,
) -> Result<Self, &'static str>
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.
Sourcepub fn with_patch_id(self, bits: u16) -> Self
pub fn with_patch_id(self, bits: u16) -> Self
Sets builder bits 48..=63.
Sourcepub fn checked_with_patch_id(self, bits: u16) -> Result<Self, &'static str>
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.
Sourcepub fn build(self) -> Relocation
pub fn build(self) -> Relocation
Builds a bitfield instance from the builder.