pub struct ResponsiveConfig {
    pub breakpoints: HashMap<Breakpoint, BreakpointConfig>,
    pub defaults: ResponsiveDefaults,
}Expand description
Configuration for responsive design
Fields§
§breakpoints: HashMap<Breakpoint, BreakpointConfig>Breakpoint configurations
defaults: ResponsiveDefaultsDefault settings
Implementations§
Source§impl ResponsiveConfig
 
impl ResponsiveConfig
Sourcepub fn with_breakpoints(
    breakpoints: HashMap<Breakpoint, BreakpointConfig>,
) -> Self
 
pub fn with_breakpoints( breakpoints: HashMap<Breakpoint, BreakpointConfig>, ) -> Self
Create a responsive configuration with custom breakpoints
Sourcepub fn get_breakpoint_config(
    &self,
    breakpoint: Breakpoint,
) -> Option<&BreakpointConfig>
 
pub fn get_breakpoint_config( &self, breakpoint: Breakpoint, ) -> Option<&BreakpointConfig>
Get configuration for a specific breakpoint
Sourcepub fn set_breakpoint_config(
    &mut self,
    breakpoint: Breakpoint,
    config: BreakpointConfig,
)
 
pub fn set_breakpoint_config( &mut self, breakpoint: Breakpoint, config: BreakpointConfig, )
Set configuration for a specific breakpoint
Sourcepub fn is_breakpoint_enabled(&self, breakpoint: Breakpoint) -> bool
 
pub fn is_breakpoint_enabled(&self, breakpoint: Breakpoint) -> bool
Check if a breakpoint is enabled
Sourcepub fn get_breakpoint_min_width(&self, breakpoint: Breakpoint) -> u32
 
pub fn get_breakpoint_min_width(&self, breakpoint: Breakpoint) -> u32
Get the minimum width for a breakpoint
Sourcepub fn get_breakpoint_max_width(&self, breakpoint: Breakpoint) -> Option<u32>
 
pub fn get_breakpoint_max_width(&self, breakpoint: Breakpoint) -> Option<u32>
Get the maximum width for a breakpoint
Sourcepub fn get_breakpoint_media_query(&self, breakpoint: Breakpoint) -> String
 
pub fn get_breakpoint_media_query(&self, breakpoint: Breakpoint) -> String
Get the media query for a breakpoint
Sourcepub fn get_enabled_breakpoints(&self) -> Vec<Breakpoint>
 
pub fn get_enabled_breakpoints(&self) -> Vec<Breakpoint>
Get all enabled breakpoints
Sourcepub fn get_breakpoint_for_width(&self, screen_width: u32) -> Breakpoint
 
pub fn get_breakpoint_for_width(&self, screen_width: u32) -> Breakpoint
Get the appropriate breakpoint for a given screen width
Trait Implementations§
Source§impl Clone for ResponsiveConfig
 
impl Clone for ResponsiveConfig
Source§fn clone(&self) -> ResponsiveConfig
 
fn clone(&self) -> ResponsiveConfig
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 ResponsiveConfig
 
impl Debug for ResponsiveConfig
Source§impl Default for ResponsiveConfig
 
impl Default for ResponsiveConfig
Source§impl<'de> Deserialize<'de> for ResponsiveConfig
 
impl<'de> Deserialize<'de> for ResponsiveConfig
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 From<ResponsiveConfigToml> for ResponsiveConfig
 
impl From<ResponsiveConfigToml> for ResponsiveConfig
Source§fn from(toml_config: ResponsiveConfigToml) -> Self
 
fn from(toml_config: ResponsiveConfigToml) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ResponsiveConfig
 
impl PartialEq for ResponsiveConfig
Source§impl Serialize for ResponsiveConfig
 
impl Serialize for ResponsiveConfig
impl StructuralPartialEq for ResponsiveConfig
Auto Trait Implementations§
impl Freeze for ResponsiveConfig
impl RefUnwindSafe for ResponsiveConfig
impl Send for ResponsiveConfig
impl Sync for ResponsiveConfig
impl Unpin for ResponsiveConfig
impl UnwindSafe for ResponsiveConfig
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