pub struct Responsive {
pub config: ResponsiveConfig,
pub current_breakpoint: Breakpoint,
}Expand description
Re-export core tailwind-rs functionality Main responsive struct that uses the configuration
Fields§
§config: ResponsiveConfigThe configuration
current_breakpoint: BreakpointCurrent breakpoint
Implementations§
Source§impl Responsive
impl Responsive
Sourcepub fn new() -> Responsive
pub fn new() -> Responsive
Create a new responsive instance
Sourcepub fn with_config(config: ResponsiveConfig) -> Responsive
pub fn with_config(config: ResponsiveConfig) -> Responsive
Create a responsive instance with custom configuration
Sourcepub fn get_current_breakpoint(&self) -> Breakpoint
pub fn get_current_breakpoint(&self) -> Breakpoint
Get the current breakpoint
Sourcepub fn set_current_breakpoint(&mut self, breakpoint: Breakpoint)
pub fn set_current_breakpoint(&mut self, breakpoint: Breakpoint)
Set the current breakpoint
Sourcepub fn get_config(&self) -> &ResponsiveConfig
pub fn get_config(&self) -> &ResponsiveConfig
Get the configuration
Sourcepub fn update_config(&mut self, config: ResponsiveConfig)
pub fn update_config(&mut self, config: ResponsiveConfig)
Update the configuration
Sourcepub fn is_breakpoint_active(
&self,
breakpoint: Breakpoint,
screen_width: u32,
) -> bool
pub fn is_breakpoint_active( &self, breakpoint: Breakpoint, screen_width: u32, ) -> bool
Check if a breakpoint is active for the current screen width
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 Responsive
impl Clone for Responsive
Source§fn clone(&self) -> Responsive
fn clone(&self) -> Responsive
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 Responsive
impl Debug for Responsive
Source§impl Default for Responsive
impl Default for Responsive
Source§fn default() -> Responsive
fn default() -> Responsive
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for Responsive
impl<'de> Deserialize<'de> for Responsive
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Responsive, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Responsive, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for Responsive
impl PartialEq for Responsive
Source§impl Serialize for Responsive
impl Serialize for Responsive
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Responsive
Auto Trait Implementations§
impl Freeze for Responsive
impl RefUnwindSafe for Responsive
impl Send for Responsive
impl Sync for Responsive
impl Unpin for Responsive
impl UnwindSafe for Responsive
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