Struct ndk::configuration::Configuration
source · [−]pub struct Configuration { /* private fields */ }
Expand description
A native AConfiguration *
Configuration
is an opaque type used to get and set various subsystem configurations.
Implementations
sourceimpl Configuration
impl Configuration
sourcepub unsafe fn from_ptr(ptr: NonNull<AConfiguration>) -> Self
pub unsafe fn from_ptr(ptr: NonNull<AConfiguration>) -> Self
Construct a Configuration
from a pointer.
Safety
By calling this function, you assert that it is a valid pointer to a native
AConfiguration
, and give ownership of it to the Configuration
instance.
sourcepub unsafe fn clone_from_ptr(ptr: NonNull<AConfiguration>) -> Self
pub unsafe fn clone_from_ptr(ptr: NonNull<AConfiguration>) -> Self
Create a new Configuration
, with the same contents as the AConfiguration
referenced by
the pointer.
This is useful if you have a pointer, but not ownership of it.
Safety
By calling this function, you assert that it is a valid pointer to a native
AConfiguration
.
sourcepub fn ptr(&self) -> NonNull<AConfiguration>
pub fn ptr(&self) -> NonNull<AConfiguration>
The pointer to the native AConfiguration
. Keep in mind that the Configuration
object
still has ownership, and will free it when dropped.
pub fn from_asset_manager(am: &AssetManager) -> Self
sourcepub fn diff(&self, other: &Self) -> DiffResult
pub fn diff(&self, other: &Self) -> DiffResult
Information about what fields differ between the two configurations
sourcepub fn matches(&self, requested: &Self) -> bool
pub fn matches(&self, requested: &Self) -> bool
Returns false if anything in self
conflicts with requested
sourcepub fn country(&self) -> Option<String>
pub fn country(&self) -> Option<String>
Returns the country code, as a String
of two characters, if set
sourcepub fn density(&self) -> Option<u32>
pub fn density(&self) -> Option<u32>
Returns the screen density in dpi.
On some devices it can return values outside of the density enum.
Returns keyboard visibility/availability.
sourcepub fn language(&self) -> Option<String>
pub fn language(&self) -> Option<String>
Returns the language, as a String
of two characters, if set
sourcepub fn layout_direction(&self) -> LayoutDir
pub fn layout_direction(&self) -> LayoutDir
Returns the layout direction
pub fn orientation(&self) -> Orientation
pub fn screen_height_dp(&self) -> Option<i32>
pub fn screen_width_dp(&self) -> Option<i32>
pub fn screen_long(&self) -> ScreenLong
pub fn screen_round(&self) -> ScreenRound
api-level-30
only.pub fn screen_size(&self) -> ScreenSize
pub fn sdk_version(&self) -> i32
pub fn smallest_screen_width_dp(&self) -> Option<i32>
pub fn touchscreen(&self) -> Touchscreen
pub fn ui_mode_night(&self) -> UiModeNight
pub fn ui_mode_type(&self) -> UiModeType
Trait Implementations
sourceimpl Clone for Configuration
impl Clone for Configuration
sourceimpl Debug for Configuration
impl Debug for Configuration
sourceimpl Drop for Configuration
impl Drop for Configuration
sourceimpl PartialEq<Configuration> for Configuration
impl PartialEq<Configuration> for Configuration
impl Eq for Configuration
impl Send for Configuration
impl Sync for Configuration
Auto Trait Implementations
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