CacheTable

Struct CacheTable 

Source
pub struct CacheTable<F, const N: usize, Y, A = Global>
where F: Float, Y: FnMut(F) -> [F; N], A: Allocator,
{ /* private fields */ }

Implementations§

Source§

impl<F, const N: usize, Y> CacheTable<F, N, Y>
where F: Float, Y: FnMut(F) -> [F; N],

Source

pub fn new(func: Y, range: Range<F>, resolution: usize) -> Self

Source§

impl<F, const N: usize, Y, A> CacheTable<F, N, Y, A>
where F: Float, Y: FnMut(F) -> [F; N], A: Allocator + Clone,

Source

pub fn new_in(func: Y, range: Range<F>, resolution: usize, alloc: A) -> Self

Source

pub fn func(&self) -> &Y

Source

pub fn func_mut(&mut self) -> &mut Y

Source

pub fn reset(&mut self)

Source

pub fn saturate(&mut self, x: F) -> [F; N]

Trait Implementations§

Source§

impl<F, const N: usize, Y, A> Clone for CacheTable<F, N, Y, A>
where F: Float + Clone, Y: FnMut(F) -> [F; N] + Clone, A: Allocator + Clone,

Source§

fn clone(&self) -> CacheTable<F, N, Y, A>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<F, const N: usize, Y, A> Debug for CacheTable<F, N, Y, A>
where F: Float + Debug, Y: FnMut(F) -> [F; N] + Debug, A: Allocator + Debug,

Source§

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

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

impl<F, const N: usize, Y, A> PartialEq for CacheTable<F, N, Y, A>
where F: Float + PartialEq, Y: FnMut(F) -> [F; N] + PartialEq, A: Allocator + PartialEq,

Source§

fn eq(&self, other: &CacheTable<F, N, Y, A>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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<F, Y, A> SaturateMut<F, RangeFull> for CacheTable<F, 1, Y, A>
where F: Float, Y: FnMut(F) -> [F; 1], A: Allocator + Clone,

Source§

fn saturate_mut(&mut self, x: F, RangeFull: RangeFull) -> F

Source§

impl<F, const N: usize, Y, A> Eq for CacheTable<F, N, Y, A>
where F: Float + Eq, Y: FnMut(F) -> [F; N] + Eq, A: Allocator + Eq,

Source§

impl<F, const N: usize, Y, A> StructuralPartialEq for CacheTable<F, N, Y, A>
where F: Float, Y: FnMut(F) -> [F; N], A: Allocator,

Auto Trait Implementations§

§

impl<F, const N: usize, Y, A> Freeze for CacheTable<F, N, Y, A>
where Y: Freeze, F: Freeze, A: Freeze,

§

impl<F, const N: usize, Y, A> RefUnwindSafe for CacheTable<F, N, Y, A>

§

impl<F, const N: usize, Y, A> Send for CacheTable<F, N, Y, A>
where Y: Send, F: Send, A: Send,

§

impl<F, const N: usize, Y, A> Sync for CacheTable<F, N, Y, A>
where Y: Sync, F: Sync, A: Sync,

§

impl<F, const N: usize, Y, A> Unpin for CacheTable<F, N, Y, A>
where Y: Unpin, F: Unpin, A: Unpin,

§

impl<F, const N: usize, Y, A> UnwindSafe for CacheTable<F, N, Y, A>
where Y: UnwindSafe, F: UnwindSafe, A: UnwindSafe,

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.