Struct clutter::Units [−][src]
pub struct Units(_);
Implementations
impl Units
[src]
pub fn get_unit_type(&self) -> UnitType
[src]
pub fn get_unit_value(&self) -> f32
[src]
pub fn to_pixels(&mut self) -> f32
[src]
pub fn from_cm(cm: f32) -> Units
[src]
pub fn from_em(em: f32) -> Units
[src]
Stores a value in em inside units
, using the default font
name as returned by Backend::get_font_name
units
a Units
em
em
pub fn from_em_for_font(font_name: Option<&str>, em: f32) -> Units
[src]
Stores a value in em inside units
using font_name
units
a Units
font_name
the font name and size
em
em
pub fn from_mm(mm: f32) -> Units
[src]
pub fn from_pixels(px: i32) -> Units
[src]
pub fn from_pt(pt: f32) -> Units
[src]
pub fn from_string(str: &str) -> Option<Units>
[src]
Parses a value and updates units
with it
A Units
expressed in string should match:
units: wsp* unit-value wsp* unit-name? wsp*
unit-value: number
unit-name: 'px' | 'pt' | 'mm' | 'em' | 'cm'
number: digit+
| digit* sep digit+
sep: '.' | ','
digit: '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'
wsp: (#0x20 | #0x9 | #0xA | #0xB | #0xC | #0xD)+
For instance, these are valid strings:
10 px
5.1 em
24 pt
12.6 mm
.3 cm
While these are not:
42 cats
omg!1!ponies
If no unit is specified, pixels are assumed.
units
a Units
str
the string to convert
Returns
true
if the string was successfully parsed,
and false
otherwise
Trait Implementations
impl Clone for Units
[src]
impl Debug for Units
[src]
impl Display for Units
[src]
impl Eq for Units
[src]
impl Hash for Units
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Units
[src]
fn cmp(&self, other: &Units) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]
pub fn max(self, other: Self) -> Self#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]
pub fn min(self, other: Self) -> Self#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
#[must_use]
pub fn clamp(self, min: Self, max: Self) -> Selfimpl PartialEq<Units> for Units
[src]
impl PartialOrd<Units> for Units
[src]
fn partial_cmp(&self, other: &Units) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn lt(&self, other: &Rhs) -> bool#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn le(&self, other: &Rhs) -> bool#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn gt(&self, other: &Rhs) -> bool#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn ge(&self, other: &Rhs) -> boolimpl StaticType for Units
[src]
fn static_type() -> Type
[src]
impl StructuralEq for Units
[src]
impl StructuralPartialEq for Units
[src]
Auto Trait Implementations
impl RefUnwindSafe for Units
impl !Send for Units
impl !Sync for Units
impl Unpin for Units
impl UnwindSafe for Units
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToSendValue for T where
T: SetValue + Send + ToValue + ?Sized,
[src]
T: SetValue + Send + ToValue + ?Sized,
pub fn to_send_value(&self) -> SendValue
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> ToValue for T where
T: SetValue + ?Sized,
[src]
T: SetValue + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,