#[repr(transparent)]pub struct Points(pub f32);Expand description
A length in points, the unit NSH lays out in (GPUI’s Pixels): the
platform’s density-independent unit (iOS / macOS points, Android dp,
CSS px on the web, DIPs on Windows). Style strings’ px and bare
numbers are points. Device pixels are DevicePixels /
ScaledPixels, met only where a platform draws or reports them.
Tuple Fields§
§0: f32Implementations§
Source§impl Points
impl Points
Sourcepub fn to_device_pixels(self, scale_factor: f32) -> DevicePixels
pub fn to_device_pixels(self, scale_factor: f32) -> DevicePixels
In device pixels at scale_factor device pixels per point,
rounded to the nearest pixel.
Sourcepub fn scale(self, scale_factor: f32) -> ScaledPixels
pub fn scale(self, scale_factor: f32) -> ScaledPixels
Scaled by scale_factor device pixels per point, unrounded (a
fractional device position).
Trait Implementations§
Source§impl AddAssign for Points
impl AddAssign for Points
Source§fn add_assign(&mut self, rhs: Points)
fn add_assign(&mut self, rhs: Points)
Performs the
+= operation. Read moreimpl Copy for Points
Source§impl<'de> Deserialize<'de> for Points
impl<'de> Deserialize<'de> for Points
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Points, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Points, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl DivAssign<f32> for Points
impl DivAssign<f32> for Points
Source§fn div_assign(&mut self, rhs: f32)
fn div_assign(&mut self, rhs: f32)
Performs the
/= operation. Read moreimpl Eq for Points
Source§impl From<Points> for AbsoluteLength
impl From<Points> for AbsoluteLength
Source§fn from(p: Points) -> AbsoluteLength
fn from(p: Points) -> AbsoluteLength
Converts to this type from the input type.
Source§impl From<Points> for DefiniteLength
impl From<Points> for DefiniteLength
Source§fn from(p: Points) -> DefiniteLength
fn from(p: Points) -> DefiniteLength
Converts to this type from the input type.
Source§impl IntoReactive<AbsoluteLength> for Points
impl IntoReactive<AbsoluteLength> for Points
Source§fn into_reactive(self) -> Reactive<AbsoluteLength>
fn into_reactive(self) -> Reactive<AbsoluteLength>
As a
Reactive.Source§impl IntoReactive<DefiniteLength> for Points
impl IntoReactive<DefiniteLength> for Points
Source§fn into_reactive(self) -> Reactive<DefiniteLength>
fn into_reactive(self) -> Reactive<DefiniteLength>
As a
Reactive.Source§impl IntoReactive<Length> for Points
impl IntoReactive<Length> for Points
Source§impl IntoReactive<LineHeight> for Points
impl IntoReactive<LineHeight> for Points
Source§fn into_reactive(self) -> Reactive<LineHeight>
fn into_reactive(self) -> Reactive<LineHeight>
As a
Reactive.Source§impl IntoReactive<Points> for Points
impl IntoReactive<Points> for Points
Source§impl JsValue for Points
A number of points.
impl JsValue for Points
A number of points.
Source§impl MulAssign<f32> for Points
impl MulAssign<f32> for Points
Source§fn mul_assign(&mut self, rhs: f32)
fn mul_assign(&mut self, rhs: f32)
Performs the
*= operation. Read moreSource§impl<Cx> OpArg<Cx> for Points
A length: values of another type are zero (as f32’s).
impl<Cx> OpArg<Cx> for Points
A length: values of another type are zero (as f32’s).
Source§impl PartialOrd for Points
impl PartialOrd for Points
Source§impl Serialize for Points
impl Serialize for Points
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Points
Source§impl SubAssign for Points
impl SubAssign for Points
Source§fn sub_assign(&mut self, rhs: Points)
fn sub_assign(&mut self, rhs: Points)
Performs the
-= operation. Read moreAuto Trait Implementations§
impl Freeze for Points
impl RefUnwindSafe for Points
impl Send for Points
impl Sync for Points
impl Unpin for Points
impl UnsafeUnpin for Points
impl UnwindSafe for Points
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
Mutably borrows from an owned value. Read more
Source§impl<T> CallbackArgs for Twhere
T: Ret,
impl<T> CallbackArgs for Twhere
T: Ret,
Source§fn ts_params(types: &mut TsTypes, names: &[&str]) -> String
fn ts_params(types: &mut TsTypes, names: &[&str]) -> String
Its TypeScript parameters, named
names (name: string, amount: number), or without names value for one and a, b, … for
several.Source§fn into_js_args<'a>(
self,
host: &'a dyn JsHost,
) -> Result<Vec<JsOwned<'a>>, PropError>
fn into_js_args<'a>( self, host: &'a dyn JsHost, ) -> Result<Vec<JsOwned<'a>>, PropError>
The arguments as JS values.
fn classes(out: &mut Vec<&'static ClassDef>)
Source§impl<T> CallbackRet for Twhere
T: JsValue,
impl<T> CallbackRet for Twhere
T: JsValue,
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.impl<T, Rhs, Output> GroupOps<Rhs, Output> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<E> IntoThrown for Ewhere
E: Display,
impl<E> IntoThrown for Ewhere
E: Display,
Source§fn into_thrown(self) -> Thrown
fn into_thrown(self) -> Thrown
The exception.