Skip to main content

ConfigRegion

Struct ConfigRegion 

Source
#[repr(C)]
pub struct ConfigRegion { pub version: u8, pub param_count: u8, pub update_seq: u16, pub _pad: [u8; 4], pub update_ns: u64, pub params: [i64; 32], pub types: [u8; 32], }
Expand description

Runtime configuration region — read by strategy, written by host.

Fixed-size (528 bytes). Each slot is 8 bytes (i64) with a type tag. Slot 0..MAX_CONFIG_PARAMS-1 are available for user-defined parameters.

Fields§

§version: u8

ABI version (currently 1).

§param_count: u8

Number of populated parameter slots.

§update_seq: u16

Incremented on every config update (strategy can detect changes).

§_pad: [u8; 4]§update_ns: u64

Timestamp of last config update (nanoseconds since epoch).

§params: [i64; 32]

Parameter values (i64, interpret per your schema).

§types: [u8; 32]

Parameter type tags: 0=i64, 1=f64_bits, 2=bool (0/1), 3=bps (i32 in lower 32 bits).

Implementations§

Source§

impl ConfigRegion

Source

pub fn get_i64(&self, slot: usize) -> i64

Get raw i64 value at slot index.

Source

pub fn get_i32(&self, slot: usize) -> i32

Get i32 value at slot index (lower 32 bits).

Source

pub fn get_f64(&self, slot: usize) -> f64

Get f64 value at slot index (from bit pattern).

Source

pub fn get_bool(&self, slot: usize) -> bool

Get bool value at slot index.

Source

pub fn get_bps(&self, slot: usize) -> i32

Get basis points value at slot index.

Source

pub fn is_updated(&self, last_seq: u16) -> bool

Whether config has been updated (compare against last seen seq).

Source

pub fn count(&self) -> usize

Number of populated parameters.

Trait Implementations§

Source§

impl Clone for ConfigRegion

Source§

fn clone(&self) -> ConfigRegion

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 Default for ConfigRegion

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Copy for ConfigRegion

Auto Trait Implementations§

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.