pub enum PercentLength {
Percent(f32),
Length(f32),
}Expand description
A length that can be specified as either a percentage of a container size or an absolute length.
Variants§
Percent(f32)
A percentage length relative to a base size.
For example, 0.5 is 50% of the base size.
Length(f32)
An absolute length. Usually in pixels.
For example, 100.0 is 100 pixels.
Implementations§
Source§impl PercentLength
impl PercentLength
Trait Implementations§
Source§impl<'__de, __Context> BorrowDecode<'__de, __Context> for PercentLength
impl<'__de, __Context> BorrowDecode<'__de, __Context> for PercentLength
Source§fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>(
decoder: &mut __D,
) -> Result<Self, DecodeError>
fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>( decoder: &mut __D, ) -> Result<Self, DecodeError>
Attempt to decode this type with the given BorrowDecode.
Source§impl Clone for PercentLength
impl Clone for PercentLength
Source§fn clone(&self) -> PercentLength
fn clone(&self) -> PercentLength
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PercentLength
Source§impl Debug for PercentLength
impl Debug for PercentLength
Source§impl<__Context> Decode<__Context> for PercentLength
impl<__Context> Decode<__Context> for PercentLength
Source§impl Default for PercentLength
impl Default for PercentLength
Source§impl Encode for PercentLength
impl Encode for PercentLength
Source§impl PartialEq for PercentLength
impl PartialEq for PercentLength
Source§fn eq(&self, other: &PercentLength) -> bool
fn eq(&self, other: &PercentLength) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PercentLength
Auto Trait Implementations§
impl Freeze for PercentLength
impl RefUnwindSafe for PercentLength
impl Send for PercentLength
impl Sync for PercentLength
impl Unpin for PercentLength
impl UnsafeUnpin for PercentLength
impl UnwindSafe for PercentLength
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