pub struct Size(/* private fields */);Expand description
A standard slot size along one axis: ¼, ⅓, ½, ⅔, ¾ of the base unit, or a whole number of units.
The value is stored in twelfths of the unit, so sums stay exact. A Size
can only hold an allowed value.
Implementations§
Source§impl Size
impl Size
Sourcepub const TWO_THIRDS: Size
pub const TWO_THIRDS: Size
Two thirds of the unit.
Sourcepub const THREE_QUARTERS: Size
pub const THREE_QUARTERS: Size
Three quarters of the unit.
Sourcepub fn from_twelfths(twelfths: u32) -> Option<Size>
pub fn from_twelfths(twelfths: u32) -> Option<Size>
The size of twelfths twelfths, if it is an allowed size.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Size
impl<'de> Deserialize<'de> for Size
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Size
impl Ord for Size
Source§impl PartialOrd for Size
impl PartialOrd for Size
impl Copy for Size
impl Eq for Size
impl StructuralPartialEq for Size
Auto Trait Implementations§
impl Freeze for Size
impl RefUnwindSafe for Size
impl Send for Size
impl Sync for Size
impl Unpin for Size
impl UnsafeUnpin for Size
impl UnwindSafe for Size
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