pub enum Breakpoint {
Xs,
Sm,
Md,
Lg,
Xl,
Xxl,
}Expand description
A responsive breakpoint corresponding to a viewport-width range.
Variants§
Xs
Extra-small: viewport width below 576 logical pixels.
Sm
Small: viewport width from 576 to 767 logical pixels.
Md
Medium: viewport width from 768 to 991 logical pixels.
Lg
Large: viewport width from 992 to 1199 logical pixels.
Xl
Extra-large: viewport width from 1200 to 1535 logical pixels.
Xxl
Extra-extra-large: viewport width at or above 1536 logical pixels.
Implementations§
Source§impl Breakpoint
impl Breakpoint
Sourcepub fn for_width(width: f32) -> Self
pub fn for_width(width: f32) -> Self
Determine the active breakpoint for a given viewport width in logical
pixels.
Sourcepub fn min_width(self) -> f32
pub fn min_width(self) -> f32
The minimum viewport width (in logical pixels) at which this breakpoint activates.
Sourcepub fn matches_width(self, width: f32) -> bool
pub fn matches_width(self, width: f32) -> bool
Returns true when width is at or above this breakpoint’s minimum.
Equivalent to a CSS @media (min-width: …) query.
Trait Implementations§
Source§impl Clone for Breakpoint
impl Clone for Breakpoint
Source§fn clone(&self) -> Breakpoint
fn clone(&self) -> Breakpoint
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 moreSource§impl Debug for Breakpoint
impl Debug for Breakpoint
Source§impl Hash for Breakpoint
impl Hash for Breakpoint
Source§impl Ord for Breakpoint
impl Ord for Breakpoint
Source§fn cmp(&self, other: &Breakpoint) -> Ordering
fn cmp(&self, other: &Breakpoint) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for Breakpoint
impl PartialEq for Breakpoint
Source§fn eq(&self, other: &Breakpoint) -> bool
fn eq(&self, other: &Breakpoint) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for Breakpoint
impl PartialOrd for Breakpoint
impl Copy for Breakpoint
impl Eq for Breakpoint
impl StructuralPartialEq for Breakpoint
Auto Trait Implementations§
impl Freeze for Breakpoint
impl RefUnwindSafe for Breakpoint
impl Send for Breakpoint
impl Sync for Breakpoint
impl Unpin for Breakpoint
impl UnsafeUnpin for Breakpoint
impl UnwindSafe for Breakpoint
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