Skip to main content

Atom

Enum Atom 

Source
pub enum Atom {
Show 24 variants Byte(u8), Fuzzy(u8), Save(u8), Skip(u8), SkipRange(u16, u16), Push(u8), Pop, Jump1, Jump4, Ptr, Pir(u8), ReadI8(u8), ReadU8(u8), ReadI16(u8), ReadU16(u8), ReadI32(u8), ReadU32(u8), Zero(u8), Back(u8), Aligned(u8), Check(u8), Case(u16), Break(u16), Nop,
}
Expand description

Pattern atoms.

Variants§

§

Byte(u8)

Matches a single byte.

§

Fuzzy(u8)

Applies a bitmask to the next byte comparison.

§

Save(u8)

Captures the cursor RVA in the save slot.

§

Skip(u8)

Skips a fixed number of bytes.

§

SkipRange(u16, u16)

Skips a ranged number of bytes (inclusive).

§

Push(u8)

Executes a recursive sub-pattern and then resumes at cursor + skip.

§

Pop

Returns from a recursive sub-pattern.

§

Jump1

Follows a signed 1-byte relative jump.

§

Jump4

Follows a signed 4-byte relative jump.

§

Ptr

Follows an absolute pointer.

§

Pir(u8)

Follows a position-independent reference from a saved base slot.

§

ReadI8(u8)

Reads and sign-extends the byte under the cursor, writes to slot, advances by 1.

§

ReadU8(u8)

Reads and zero-extends the byte under the cursor, writes to slot, advances by 1.

§

ReadI16(u8)

Reads a little-endian i16, sign-extends, stores in save slot, advances by 2.

§

ReadU16(u8)

Reads a little-endian u16, zero-extends, stores in save slot, advances by 2.

§

ReadI32(u8)

Reads a little-endian i32, sign-extends, stores in save slot, advances by 4.

§

ReadU32(u8)

Reads a little-endian u32, stores it in save slot, and advances the cursor by 4.

§

Zero(u8)

Writes zero to the given save slot without advancing the cursor.

§

Back(u8)

Rewinds the cursor by a fixed number of bytes.

§

Aligned(u8)

Fails if the cursor is not aligned to (1 << value) bytes.

§

Check(u8)

Fails if the cursor does not equal the value in the given save slot.

§

Case(u16)

Branches to an alternate pattern arm on failure.

§

Break(u16)

Jumps past remaining alternate arms when current arm succeeds.

§

Nop

No-op instruction used to keep pattern control-flow offsets stable.

Trait Implementations§

Source§

impl Clone for Atom

Source§

fn clone(&self) -> Atom

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Atom

Source§

impl Debug for Atom

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for Atom

Source§

impl PartialEq for Atom

Source§

fn eq(&self, other: &Atom) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Atom

Auto Trait Implementations§

§

impl Freeze for Atom

§

impl RefUnwindSafe for Atom

§

impl Send for Atom

§

impl Sync for Atom

§

impl Unpin for Atom

§

impl UnsafeUnpin for Atom

§

impl UnwindSafe for Atom

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.