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
sourceimpl 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
sourceimpl Debug for AndroidSystemProperties
impl Debug for AndroidSystemProperties
sourceimpl Drop for AndroidSystemProperties
impl Drop for AndroidSystemProperties
impl Send for AndroidSystemProperties
impl Sync for AndroidSystemProperties
Auto Trait Implementations
impl RefUnwindSafe for AndroidSystemProperties
impl Unpin for AndroidSystemProperties
impl UnwindSafe for AndroidSystemProperties
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more