Struct Gain State
pub struct GainState { /* private fields */ }Expand description
A validated gain snapshot, suitable for complete atomic publication.
Implementations§
§impl GainState
impl GainState
pub fn new(gain: f32) -> Result<Self, StateError>
pub fn new(gain: f32) -> Result<Self, StateError>
State rejects out-of-range values rather than clamping damaged records. Negative zero is canonicalized to positive zero.
pub fn gain(self) -> f32
pub fn encode(self) -> [u8; 20]
pub fn decode(bytes: &[u8]) -> Result<Self, StateError>
pub fn decode(bytes: &[u8]) -> Result<Self, StateError>
Version one is the first persisted schema. Unknown versions fail closed; future migrations must retain version-one fixture coverage.
Trait Implementations§
impl Copy for GainState
impl StructuralPartialEq for GainState
Auto Trait Implementations§
impl Freeze for GainState
impl RefUnwindSafe for GainState
impl Send for GainState
impl Sync for GainState
impl Unpin for GainState
impl UnsafeUnpin for GainState
impl UnwindSafe for GainState
Blanket Implementations§
impl<T> AutoreleaseSafe for T
§impl<T> BorrowMut<T> for T
impl<T> BorrowMut<T> for T
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more