pub struct Spacing {
pub base: u32,
}Expand description
Spacing scale for consistent padding, margin, and gap values.
All values are in terminal cells. The scale is relative to Spacing::base,
which defaults to 1 cell. Use Theme::spacing to access the active scale,
or crate::Context::spacing for convenience.
§Example
use slt::Spacing;
let sp = Spacing::new(1);
assert_eq!(sp.sm(), 2);
assert_eq!(sp.md(), 3);
assert_eq!(sp.xl(), 6);Fields§
§base: u32Base unit in terminal cells. Defaults to 1.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Spacing
impl<'de> Deserialize<'de> for Spacing
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
impl Copy for Spacing
impl Eq for Spacing
impl StructuralPartialEq for Spacing
Auto Trait Implementations§
impl Freeze for Spacing
impl RefUnwindSafe for Spacing
impl Send for Spacing
impl Sync for Spacing
impl Unpin for Spacing
impl UnsafeUnpin for Spacing
impl UnwindSafe for Spacing
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