pub struct AndroidSystemProperties { /* private fields */ }
Expand description
An object that can retrieve android system properties.
§Example
use android_system_properties::AndroidSystemProperties;
let properties = AndroidSystemProperties::new();
if let Some(value) = properties.get("persist.sys.timezone") {
println!("{}", value);
}
Implementations§
Source§impl AndroidSystemProperties
impl AndroidSystemProperties
Sourcepub fn get(&self, name: &str) -> Option<String>
pub fn get(&self, name: &str) -> Option<String>
Retrieve a system property.
Returns None if the operation fails.
§Example
let properties = AndroidSystemProperties::new();
if let Some(value) = properties.get("persist.sys.timezone") {
println!("{}", value);
}
Sourcepub fn get_from_cstr(&self, cname: &CStr) -> Option<String>
pub fn get_from_cstr(&self, cname: &CStr) -> Option<String>
Retrieve a system property using a CStr
key.
Returns None if the operation fails.
§Example
let properties = AndroidSystemProperties::new();
let key = unsafe { CStr::from_bytes_with_nul_unchecked(b"persist.sys.timezone\0") };
if let Some(value) = properties.get_from_cstr(key) {
println!("{}", value);
}
Trait Implementations§
Source§impl Debug for AndroidSystemProperties
impl Debug for AndroidSystemProperties
Source§impl Drop for AndroidSystemProperties
impl Drop for AndroidSystemProperties
impl Send for AndroidSystemProperties
impl Sync for AndroidSystemProperties
Auto Trait Implementations§
impl Freeze for AndroidSystemProperties
impl RefUnwindSafe for AndroidSystemProperties
impl Unpin for AndroidSystemProperties
impl UnwindSafe for AndroidSystemProperties
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