pub struct Breakpoint {
pub name: String,
pub min_width: Option<String>,
pub max_width: Option<String>,
}Expand description
A viewport width breakpoint.
Fields§
§name: StringBreakpoint name (e.g., “mobile”, “tablet”, “desktop”).
min_width: Option<String>Minimum viewport width (inclusive).
max_width: Option<String>Maximum viewport width (inclusive).
Implementations§
Source§impl Breakpoint
impl Breakpoint
Sourcepub fn new(
name: impl Into<String>,
min_width: Option<String>,
max_width: Option<String>,
) -> Self
pub fn new( name: impl Into<String>, min_width: Option<String>, max_width: Option<String>, ) -> Self
Create a new breakpoint with a name and min/max widths.
Sourcepub fn large_desktop() -> Self
pub fn large_desktop() -> Self
Create a large desktop breakpoint (min-width: 1440px).
Sourcepub fn to_media_query(&self) -> String
pub fn to_media_query(&self) -> String
Convert to a CSS media 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 · 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<'de> Deserialize<'de> for Breakpoint
impl<'de> Deserialize<'de> for Breakpoint
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 PartialEq for Breakpoint
impl PartialEq for Breakpoint
Source§impl Serialize for Breakpoint
impl Serialize 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.