pub struct Configuration { /* private fields */ }
Expand description
A native AConfiguration *
.
This stores information about configuration. See the NDK docs
Implementations§
Source§impl 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.
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.
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.
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
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 a language is 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
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§
Source§impl Clone for Configuration
impl Clone for Configuration
Source§impl Debug for Configuration
impl Debug for Configuration
Source§impl Drop for Configuration
impl Drop for Configuration
Source§impl PartialEq for Configuration
impl PartialEq for Configuration
impl Eq for Configuration
impl Send for Configuration
impl Sync for Configuration
Auto Trait Implementations§
impl Freeze for Configuration
impl RefUnwindSafe for Configuration
impl Unpin for Configuration
impl UnwindSafe for Configuration
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more