#[repr(C)]pub struct FunctionData {
pub initialized: u32,
pub domain_start: [u8; 16],
pub domain_end: [u8; 16],
pub interval: [u8; 16],
pub values: [[u8; 16]; 200000],
pub value_codes: [u8; 200000],
pub num_values: u32,
pub num_values_loaded: u32,
pub function_type: u32,
}
Fields§
§initialized: u32
§domain_start: [u8; 16]
§domain_end: [u8; 16]
§interval: [u8; 16]
§values: [[u8; 16]; 200000]
§value_codes: [u8; 200000]
§num_values: u32
§num_values_loaded: u32
§function_type: u32
Trait Implementations§
Source§impl AccountDeserialize for FunctionData
impl AccountDeserialize for FunctionData
Source§fn try_deserialize(buf: &mut &[u8]) -> Result<Self>
fn try_deserialize(buf: &mut &[u8]) -> Result<Self>
Deserializes previously initialized account data. Should fail for all
uninitialized accounts, where the bytes are zeroed. Implementations
should be unique to a particular account type so that one can never
successfully deserialize the data of one account type into another.
For example, if the SPL token program were to implement this trait,
it should be impossible to deserialize a
Mint
account into a token
Account
.Source§fn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<Self>
fn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<Self>
Deserializes account data without checking the account discriminator.
This should only be used on account initialization, when the bytes of
the account are zeroed.
Source§impl Clone for FunctionData
impl Clone for FunctionData
Source§fn clone(&self) -> FunctionData
fn clone(&self) -> FunctionData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Discriminator for FunctionData
impl Discriminator for FunctionData
const DISCRIMINATOR: [u8; 8]
fn discriminator() -> [u8; 8]
Source§impl FunctionDataAccessors for FunctionData
impl FunctionDataAccessors for FunctionData
fn eval( &self, x: Decimal, interp: Interpolation, saturating: bool, ) -> Result<Decimal>
fn eval_load( &self, x_in: Decimal, y_in: Decimal, ) -> Result<(Decimal, ValueCode)>
fn get_values_array(&self) -> &[[u8; 16]; 200000]
fn get_value_codes_array(&self) -> &[u8; 200000]
fn get_values_array_mut(&mut self) -> &mut [[u8; 16]; 200000]
fn get_value_codes_array_mut(&mut self) -> &mut [u8; 200000]
fn get_function_type(&self) -> u32
fn set_function_type(&mut self, ft: FunctionType) -> Result<()>
fn get_domain_start(&self) -> Result<Decimal>
fn set_domain_start(&mut self, domain_start_raw: [u8; 16]) -> Result<()>
fn get_domain_end(&self) -> Result<Decimal>
fn set_domain_end(&mut self, domain_end_raw: [u8; 16]) -> Result<()>
fn get_interval(&self) -> Result<Decimal>
fn set_interval(&mut self, interval: [u8; 16]) -> Result<()>
fn get_num_values_loaded(&self) -> u32
fn increment_num_values_loaded(&mut self) -> Result<()>
fn get_is_initialized(&self) -> bool
fn set_initialized_true(&mut self) -> Result<()>
fn get_num_values(&self) -> Result<u32>
fn set_num_values(&mut self, num_values: u32) -> Result<()>
fn set_value( &mut self, index: u32, value: [u8; 16], value_code: u8, ) -> Result<()>
fn get_value(&self, index: u32) -> Result<Decimal>
fn get_value_code(&self, index: u32) -> Result<u8>
fn reduce_value_codes_from_indices( &self, indices: Vec<u32>, ) -> Result<ValueCode>
fn get_domain(&self) -> Result<Decimal>
fn get_x_from_index(&self, index: u32) -> Result<Decimal>
fn get_index_bounds(&self, x: Decimal) -> Result<(u32, u32, Decimal)>
impl Copy for FunctionData
impl Pod for FunctionData
impl ZeroCopy for FunctionData
Auto Trait Implementations§
impl Freeze for FunctionData
impl RefUnwindSafe for FunctionData
impl Send for FunctionData
impl Sync for FunctionData
impl Unpin for FunctionData
impl UnwindSafe for FunctionData
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
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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