pub struct Config(/* private fields */);Expand description
A set of resource qualifiers. Config::default() matches any device.
Implementations§
Source§impl Config
impl Config
Sourcepub fn for_locale(locale: Locale) -> Self
pub fn for_locale(locale: Locale) -> Self
A configuration with only a locale.
Sourcepub fn for_density(density: Density) -> Self
pub fn for_density(density: Density) -> Self
A configuration with only a density.
pub fn is_default(&self) -> bool
pub fn locale(&self) -> Option<Locale>
pub fn with_locale(self, locale: Locale) -> Self
pub fn density(&self) -> Density
pub fn with_density(self, density: Density) -> Self
pub fn night_mode(&self) -> NightMode
pub fn with_night_mode(self, mode: NightMode) -> Self
pub fn orientation(&self) -> Orientation
pub fn with_orientation(self, orientation: Orientation) -> Self
pub fn layout_direction(&self) -> LayoutDirection
pub fn with_layout_direction(self, direction: LayoutDirection) -> Self
Sourcepub fn sdk_version(&self) -> u16
pub fn sdk_version(&self) -> u16
The minimum API level (-vNN), or 0 when unqualified.
pub fn with_sdk_version(self, api_level: u16) -> Self
pub fn smallest_screen_width_dp(&self) -> u16
pub fn with_smallest_screen_width_dp(self, dp: u16) -> Self
Trait Implementations§
impl Copy for Config
impl Eq for Config
Source§impl FromStr for Config
impl FromStr for Config
Source§fn from_str(text: &str) -> Result<Self, QualifierError>
fn from_str(text: &str) -> Result<Self, QualifierError>
Parses resource directory qualifiers, e.g. fr-rCA-night-xxhdpi-v26.
Like aapt2, each kind of qualifier may appear once, in a fixed order.
Source§type Err = QualifierError
type Err = QualifierError
The associated error which can be returned from parsing.
Source§impl Ord for Config
impl Ord for Config
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Config
impl PartialOrd for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<T> CustomError for T
impl<T> CustomError for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.