pub struct LabelOrOffset(/* private fields */);Expand description
A MachLabel or CodeOffset, bitpacked into a u32.
This type is used to represent a label reference in some
MachBuffer metadata (specifically, relocations and
exception-handler records). These start as labels before the
MachBuffer is finalized; once finish() is called, they become
code offsets.
Implementations§
Source§impl LabelOrOffset
impl LabelOrOffset
Sourcepub fn offset(offset: CodeOffset) -> Self
pub fn offset(offset: CodeOffset) -> Self
Create a LabelOrOffset that refers to a code offset.
Sourcepub fn as_offset(&self) -> CodeOffset
pub fn as_offset(&self) -> CodeOffset
Trait Implementations§
Source§impl Clone for LabelOrOffset
impl Clone for LabelOrOffset
Source§fn clone(&self) -> LabelOrOffset
fn clone(&self) -> LabelOrOffset
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for LabelOrOffset
Source§impl Debug for LabelOrOffset
impl Debug for LabelOrOffset
Source§impl<'de> Deserialize<'de> for LabelOrOffset
Available on crate feature enable-serde only.
impl<'de> Deserialize<'de> for LabelOrOffset
Available on crate feature
enable-serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for LabelOrOffset
impl Display for LabelOrOffset
impl Eq for LabelOrOffset
Source§impl From<MachLabel> for LabelOrOffset
impl From<MachLabel> for LabelOrOffset
Source§impl Hash for LabelOrOffset
impl Hash for LabelOrOffset
Source§impl PartialEq for LabelOrOffset
impl PartialEq for LabelOrOffset
Source§impl Serialize for LabelOrOffset
Available on crate feature enable-serde only.
impl Serialize for LabelOrOffset
Available on crate feature
enable-serde only.impl StructuralPartialEq for LabelOrOffset
Auto Trait Implementations§
impl Freeze for LabelOrOffset
impl RefUnwindSafe for LabelOrOffset
impl Send for LabelOrOffset
impl Sync for LabelOrOffset
impl Unpin for LabelOrOffset
impl UnsafeUnpin for LabelOrOffset
impl UnwindSafe for LabelOrOffset
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.