Skip to main content

InterpBackend

Struct InterpBackend 

Source
pub(crate) struct InterpBackend<'a> {
    buf: *mut u8,
    len: usize,
    now: f64,
    result: Option<EvalResult>,
    trace: Option<TraceState<'a>>,
    _phantom: PhantomData<&'a mut DenseBuffer>,
}

Fields§

§buf: *mut u8§len: usize§now: f64§result: Option<EvalResult>§trace: Option<TraceState<'a>>§_phantom: PhantomData<&'a mut DenseBuffer>

Implementations§

Source§

impl<'a> InterpBackend<'a>

Source

pub(crate) fn new(frame: InterpFrame<'a>) -> Self

Source

pub(crate) fn with_sink( frame: InterpFrame<'a>, sink: DecisionTraceTarget, ctx: RecorderCtx<'a>, ) -> Self

Source

pub(crate) fn finish(self) -> EvalResult

Source

fn bytes(&self) -> &[u8]

Source

fn capture(&mut self, r: EvalResult)

Trait Implementations§

Source§

impl RotationBackend for InterpBackend<'_>

Source§

type Bool = bool

Source§

type Int = i64

Source§

type Float = f64

Source§

fn const_bool(&mut self, v: bool) -> bool

Source§

fn const_i32(&mut self, v: i32) -> i64

Source§

fn const_i64(&mut self, v: i64) -> i64

Source§

fn const_f64(&mut self, v: f64) -> f64

Source§

fn load_bool(&mut self, offset: usize) -> bool

Source§

fn load_i32(&mut self, offset: usize) -> i64

Source§

fn load_i64(&mut self, offset: usize) -> i64

Source§

fn load_f64(&mut self, offset: usize) -> f64

Source§

fn store_bool(&mut self, offset: usize, v: bool)

Source§

fn store_i32(&mut self, offset: usize, v: i64)

Source§

fn store_f64(&mut self, offset: usize, v: f64)

Source§

fn now(&mut self) -> f64

Source§

fn add_f(&mut self, a: f64, b: f64) -> f64

Source§

fn sub_f(&mut self, a: f64, b: f64) -> f64

Source§

fn mul_f(&mut self, a: f64, b: f64) -> f64

Source§

fn safe_div_f(&mut self, a: f64, b: f64) -> f64

Returns 0.0 for any /0 (mirrors wowlab_types::numeric::safe_div).
Source§

fn true_mod_f(&mut self, a: f64, b: f64) -> f64

Source§

fn min_f(&mut self, a: f64, b: f64) -> f64

Source§

fn max_f(&mut self, a: f64, b: f64) -> f64

Source§

fn floor_f(&mut self, v: f64) -> f64

Source§

fn ceil_f(&mut self, v: f64) -> f64

Source§

fn abs_f(&mut self, v: f64) -> f64

Source§

fn cmp_gt_f(&mut self, a: f64, b: f64) -> bool

Source§

fn cmp_gte_f(&mut self, a: f64, b: f64) -> bool

Source§

fn cmp_lt_f(&mut self, a: f64, b: f64) -> bool

Source§

fn cmp_lte_f(&mut self, a: f64, b: f64) -> bool

Source§

fn cmp_eq_f(&mut self, a: f64, b: f64) -> bool

Epsilon-aware (mirrors wowlab_types::numeric::float_eq).
Source§

fn cmp_ne_f(&mut self, a: f64, b: f64) -> bool

Epsilon-aware (mirrors wowlab_types::numeric::float_ne).
Source§

fn cmp_eq_i(&mut self, a: i64, b: i64) -> bool

Source§

fn cmp_ne_i(&mut self, a: i64, b: i64) -> bool

Source§

fn cmp_gt_i(&mut self, a: i64, b: i64) -> bool

Source§

fn cmp_gte_i(&mut self, a: i64, b: i64) -> bool

Source§

fn cmp_lt_i(&mut self, a: i64, b: i64) -> bool

Source§

fn cmp_lte_i(&mut self, a: i64, b: i64) -> bool

Source§

fn and_b(&mut self, a: bool, b: bool) -> bool

Source§

fn or_b(&mut self, a: bool, b: bool) -> bool

Source§

fn not_b(&mut self, a: bool) -> bool

Source§

fn bool_to_float(&mut self, v: bool) -> f64

Source§

fn bool_to_int(&mut self, v: bool) -> i64

Source§

fn int_to_float(&mut self, v: i64) -> f64

Source§

fn int_to_bool(&mut self, v: i64) -> bool

Source§

fn float_to_bool(&mut self, v: f64) -> bool

Exact v != 0.0.
Source§

fn float_to_int(&mut self, v: f64) -> i64

v as i64 (truncates).
Source§

fn select_f(&mut self, cond: bool, t: f64, f: f64) -> f64

Source§

fn select_i(&mut self, cond: bool, t: i64, f: i64) -> i64

Source§

fn select_b(&mut self, cond: bool, t: bool, f: bool) -> bool

Source§

fn return_none_if(&mut self, cond: bool)

Source§

fn return_cast_if(&mut self, cond: bool, spell_id: u32, empower_rank: u8)

Source§

fn return_wait_if(&mut self, cond: bool, seconds: f32)

Source§

fn return_pool_if(&mut self, cond: bool, target: f32)

Source§

fn return_use_item_if(&mut self, cond: bool, gear_slot: u8, empower_rank: u8)

Source§

fn return_none(&mut self)

Source§

fn record_action(&mut self, record: ActionRecord<'_>)

Source§

fn record_action_guarded( &mut self, list_id: &str, action_index: usize, _action: &RotationAction, is_terminator: bool, guard_held: bool, failing: &Condition, )

Source§

fn begin_list_recording(&mut self, list_id: &str)

Source§

fn end_list_recording(&mut self)

Auto Trait Implementations§

§

impl<'a> Freeze for InterpBackend<'a>

§

impl<'a> !RefUnwindSafe for InterpBackend<'a>

§

impl<'a> !Send for InterpBackend<'a>

§

impl<'a> !Sync for InterpBackend<'a>

§

impl<'a> Unpin for InterpBackend<'a>

§

impl<'a> UnsafeUnpin for InterpBackend<'a>

§

impl<'a> !UnwindSafe for InterpBackend<'a>

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more