pub struct Args(_);
Expand description
A list of key=value pairs.
Implementations§
source§impl Args
impl Args
sourcepub unsafe fn from_raw(a: SoapySDRKwargs) -> Args
pub unsafe fn from_raw(a: SoapySDRKwargs) -> Args
Safety
Be careful that SoapySDRKwargs
is either:
SoapySDRKwargs::keys
andSoapySDRKwargs::vals
are null andSoapySDRKwargs::size
is 0 orSoapySDRKwargs::keys
andSoapySDRKwargs::vals
both point to valid keys and vals ofSoapySDRKwargs::size
length.
pub fn as_raw(&mut self) -> *mut SoapySDRKwargs
pub fn as_raw_const(&self) -> *const SoapySDRKwargs
sourcepub fn get<'a>(&'a self, key: &str) -> Option<&'a str>
pub fn get<'a>(&'a self, key: &str) -> Option<&'a str>
Get the value corresponding to a key in the arguments list.
Example:
use soapysdr::Args;
let args: Args = "serial=123456".into();
assert_eq!(args.get("serial"), Some("123456"));
sourcepub fn iter(&self) -> ArgsIterator<'_> ⓘ
pub fn iter(&self) -> ArgsIterator<'_> ⓘ
Get an iterator over the (key, value) pairs in the arguments list.
Example:
use soapysdr::Args;
let args: Args = "driver=lime, serial=123456".into();
let mut i = args.iter();
assert_eq!(i.next(), Some(("driver", "lime")));
assert_eq!(i.next(), Some(("serial", "123456")));
assert_eq!(i.next(), None);
Trait Implementations§
source§impl<'a, K: Eq + Hash, V> From<&'a HashMap<K, V, RandomState>> for Argswhere
&'a K: Into<Vec<u8>>,
&'a V: Into<Vec<u8>>,
impl<'a, K: Eq + Hash, V> From<&'a HashMap<K, V, RandomState>> for Argswhere &'a K: Into<Vec<u8>>, &'a V: Into<Vec<u8>>,
Auto Trait Implementations§
impl RefUnwindSafe for Args
impl !Send for Args
impl !Sync for Args
impl Unpin for Args
impl UnwindSafe for Args
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