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>
impl<'a> InterpBackend<'a>
pub(crate) fn new(frame: InterpFrame<'a>) -> Self
pub(crate) fn with_sink( frame: InterpFrame<'a>, sink: DecisionTraceTarget, ctx: RecorderCtx<'a>, ) -> Self
pub(crate) fn finish(self) -> EvalResult
fn bytes(&self) -> &[u8] ⓘ
fn capture(&mut self, r: EvalResult)
Trait Implementations§
Source§impl RotationBackend for InterpBackend<'_>
impl RotationBackend for InterpBackend<'_>
type Bool = bool
type Int = i64
type Float = f64
fn const_bool(&mut self, v: bool) -> bool
fn const_i32(&mut self, v: i32) -> i64
fn const_i64(&mut self, v: i64) -> i64
fn const_f64(&mut self, v: f64) -> f64
fn load_bool(&mut self, offset: usize) -> bool
fn load_i32(&mut self, offset: usize) -> i64
fn load_i64(&mut self, offset: usize) -> i64
fn load_f64(&mut self, offset: usize) -> f64
fn store_bool(&mut self, offset: usize, v: bool)
fn store_i32(&mut self, offset: usize, v: i64)
fn store_f64(&mut self, offset: usize, v: f64)
fn now(&mut self) -> f64
fn add_f(&mut self, a: f64, b: f64) -> f64
fn sub_f(&mut self, a: f64, b: f64) -> f64
fn mul_f(&mut self, a: f64, b: f64) -> f64
Source§fn safe_div_f(&mut self, a: f64, b: f64) -> f64
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
fn true_mod_f(&mut self, a: f64, b: f64) -> f64
Mirrors
wowlab_types::numeric::true_mod.fn min_f(&mut self, a: f64, b: f64) -> f64
fn max_f(&mut self, a: f64, b: f64) -> f64
fn floor_f(&mut self, v: f64) -> f64
fn ceil_f(&mut self, v: f64) -> f64
fn abs_f(&mut self, v: f64) -> f64
fn cmp_gt_f(&mut self, a: f64, b: f64) -> bool
fn cmp_gte_f(&mut self, a: f64, b: f64) -> bool
fn cmp_lt_f(&mut self, a: f64, b: f64) -> bool
fn cmp_lte_f(&mut self, a: f64, b: f64) -> bool
Source§fn cmp_eq_f(&mut self, a: f64, b: f64) -> bool
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
fn cmp_ne_f(&mut self, a: f64, b: f64) -> bool
Epsilon-aware (mirrors
wowlab_types::numeric::float_ne).fn cmp_eq_i(&mut self, a: i64, b: i64) -> bool
fn cmp_ne_i(&mut self, a: i64, b: i64) -> bool
fn cmp_gt_i(&mut self, a: i64, b: i64) -> bool
fn cmp_gte_i(&mut self, a: i64, b: i64) -> bool
fn cmp_lt_i(&mut self, a: i64, b: i64) -> bool
fn cmp_lte_i(&mut self, a: i64, b: i64) -> bool
fn and_b(&mut self, a: bool, b: bool) -> bool
fn or_b(&mut self, a: bool, b: bool) -> bool
fn not_b(&mut self, a: bool) -> bool
fn bool_to_float(&mut self, v: bool) -> f64
fn bool_to_int(&mut self, v: bool) -> i64
fn int_to_float(&mut self, v: i64) -> f64
fn int_to_bool(&mut self, v: i64) -> bool
Source§fn float_to_bool(&mut self, v: f64) -> bool
fn float_to_bool(&mut self, v: f64) -> bool
Exact
v != 0.0.Source§fn float_to_int(&mut self, v: f64) -> i64
fn float_to_int(&mut self, v: f64) -> i64
v as i64 (truncates).fn select_f(&mut self, cond: bool, t: f64, f: f64) -> f64
fn select_i(&mut self, cond: bool, t: i64, f: i64) -> i64
fn select_b(&mut self, cond: bool, t: bool, f: bool) -> bool
fn return_none_if(&mut self, cond: bool)
fn return_cast_if(&mut self, cond: bool, spell_id: u32, empower_rank: u8)
fn return_wait_if(&mut self, cond: bool, seconds: f32)
fn return_pool_if(&mut self, cond: bool, target: f32)
fn return_use_item_if(&mut self, cond: bool, gear_slot: u8, empower_rank: u8)
fn return_none(&mut self)
fn record_action(&mut self, record: ActionRecord<'_>)
fn record_action_guarded( &mut self, list_id: &str, action_index: usize, _action: &RotationAction, is_terminator: bool, guard_held: bool, failing: &Condition, )
fn begin_list_recording(&mut self, list_id: &str)
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> 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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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