Struct dynasmrt::components::StaticLabel
source · pub struct StaticLabel { /* private fields */ }
Expand description
A static label represents either a local label or a global label reference.
Global labels are unique names, which can be referenced multiple times, but only defined once (per-crate::Assembler).
Local labels are non-unique names. They can be referenced multiple times, and any reference indicates if they refer to a label after the reference, or a label before the reference.
A static label records how many local labels with the same name have been emitted beforehand so we can treat them as local labels as well.
Implementations§
source§impl StaticLabel
impl StaticLabel
sourcepub fn global(name: &'static str) -> StaticLabel
pub fn global(name: &'static str) -> StaticLabel
Create a new static label for a global label
sourcepub fn local(name: &'static str, version: usize) -> StaticLabel
pub fn local(name: &'static str, version: usize) -> StaticLabel
Create a new static label for a local label, with the given version id to distinguish it.
sourcepub fn next(self) -> StaticLabel
pub fn next(self) -> StaticLabel
Returns the static label targetting the label with the same name, after this one. if it is a global label, returns a copy of itself.
sourcepub fn first(name: &'static str) -> StaticLabel
pub fn first(name: &'static str) -> StaticLabel
Returns the representation of the first local label used with the given name.
Trait Implementations§
source§impl Clone for StaticLabel
impl Clone for StaticLabel
source§fn clone(&self) -> StaticLabel
fn clone(&self) -> StaticLabel
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for StaticLabel
impl Debug for StaticLabel
source§impl Hash for StaticLabel
impl Hash for StaticLabel
source§impl PartialEq for StaticLabel
impl PartialEq for StaticLabel
source§fn eq(&self, other: &StaticLabel) -> bool
fn eq(&self, other: &StaticLabel) -> bool
self
and other
values to be equal, and is used
by ==
.impl Copy for StaticLabel
impl Eq for StaticLabel
impl StructuralPartialEq for StaticLabel
Auto Trait Implementations§
impl Freeze for StaticLabel
impl RefUnwindSafe for StaticLabel
impl Send for StaticLabel
impl Sync for StaticLabel
impl Unpin for StaticLabel
impl UnwindSafe for StaticLabel
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)