pub enum Gain {
Auto,
Manual(f64),
Elements(Vec<GainElement>),
}Expand description
Unified gain configuration across all SDR devices
This enum provides a consistent interface for configuring tuner gain across different SDR hardware (RTL-SDR, SoapySDR, PlutoSDR).
§Examples
use desperado::Gain;
// Automatic gain control
let auto_gain = Gain::Auto;
// Manual gain of 49.6 dB
let manual_gain = Gain::Manual(49.6);Variants§
Auto
Automatic gain control (AGC)
Manual(f64)
Manual gain in dB (global setting)
Elements(Vec<GainElement>)
Element-specific gain settings (e.g., LNA, MIX, IF for different devices)
Implementations§
Source§impl Gain
impl Gain
Sourcepub fn parse(input: &str) -> Result<Self>
pub fn parse(input: &str) -> Result<Self>
Parse a gain setting from a string
Supports:
- “auto” -> Gain::Auto
- “48.6” -> Gain::Manual(48.6)
- “IF=8,LNA=8,MIX=0” -> Gain::Elements(…)
§Examples
use desperado::Gain;
let auto = Gain::parse("auto").unwrap();
let manual = Gain::parse("48.6").unwrap();
let elements = Gain::parse("IF=8,LNA=8,MIX=0").unwrap();Trait Implementations§
Source§impl<'de> Deserialize<'de> for Gain
impl<'de> Deserialize<'de> for Gain
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Gain
Auto Trait Implementations§
impl Freeze for Gain
impl RefUnwindSafe for Gain
impl Send for Gain
impl Sync for Gain
impl Unpin for Gain
impl UnwindSafe for Gain
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