pub struct Constrain<V> {
pub content: V,
pub space: Space,
}
Expand description
A view that constrains its content to a given space.
Fields§
§content: V
The content to constrain.
space: Space
The space to constrain the content to.
Implementations§
Source§impl<V> Constrain<V>
impl<V> Constrain<V>
Sourcepub fn min_height(self, min_height: f32) -> Self
pub fn min_height(self, min_height: f32) -> Self
Set the minimum height.
Sourcepub fn max_height(self, max_height: f32) -> Self
pub fn max_height(self, max_height: f32) -> Self
Set the maximum height.
Trait Implementations§
Source§impl<T, V: View<T>> View<T> for Constrain<V>
impl<T, V: View<T>> View<T> for Constrain<V>
Source§type State = <V as View<T>>::State
type State = <V as View<T>>::State
The state of the view, see top-level documentation for more information.
Source§fn build(&mut self, cx: &mut BuildCx<'_, '_>, data: &mut T) -> Self::State
fn build(&mut self, cx: &mut BuildCx<'_, '_>, data: &mut T) -> Self::State
Build the view state, see top-level documentation for more information.
Source§fn rebuild(
&mut self,
state: &mut Self::State,
cx: &mut RebuildCx<'_, '_>,
data: &mut T,
old: &Self,
)
fn rebuild( &mut self, state: &mut Self::State, cx: &mut RebuildCx<'_, '_>, data: &mut T, old: &Self, )
Rebuild the view state, see top-level documentation for more information.
Source§fn event(
&mut self,
state: &mut Self::State,
cx: &mut EventCx<'_, '_>,
data: &mut T,
event: &Event,
) -> bool
fn event( &mut self, state: &mut Self::State, cx: &mut EventCx<'_, '_>, data: &mut T, event: &Event, ) -> bool
Handle an event, see top-level documentation for more information.
Auto Trait Implementations§
impl<V> Freeze for Constrain<V>where
V: Freeze,
impl<V> RefUnwindSafe for Constrain<V>where
V: RefUnwindSafe,
impl<V> Send for Constrain<V>where
V: Send,
impl<V> Sync for Constrain<V>where
V: Sync,
impl<V> Unpin for Constrain<V>where
V: Unpin,
impl<V> UnwindSafe for Constrain<V>where
V: UnwindSafe,
Blanket Implementations§
Source§impl<T, V> AnyView<T> for V
impl<T, V> AnyView<T> for V
Source§fn dyn_build(&mut self, cx: &mut BuildCx<'_, '_>, data: &mut T) -> Box<dyn Any>
fn dyn_build(&mut self, cx: &mut BuildCx<'_, '_>, data: &mut T) -> Box<dyn Any>
Build the view.
Source§fn dyn_rebuild(
&mut self,
state: &mut Box<dyn Any>,
cx: &mut RebuildCx<'_, '_>,
data: &mut T,
old: &dyn AnyView<T>,
)
fn dyn_rebuild( &mut self, state: &mut Box<dyn Any>, cx: &mut RebuildCx<'_, '_>, data: &mut T, old: &dyn AnyView<T>, )
Rebuild the view.
Source§fn dyn_event(
&mut self,
state: &mut Box<dyn Any>,
cx: &mut EventCx<'_, '_>,
data: &mut T,
event: &Event,
) -> bool
fn dyn_event( &mut self, state: &mut Box<dyn Any>, cx: &mut EventCx<'_, '_>, data: &mut T, event: &Event, ) -> bool
Handle an event.
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