pub struct ClipperBuffer<'a, W>{ /* private fields */ }Expand description
Second stage: render widgets to the temporary buffer.
Implementations§
Source§impl<'a, W> ClipperBuffer<'a, W>
impl<'a, W> ClipperBuffer<'a, W>
Sourcepub fn is_visible(&self, widget: W) -> bool
pub fn is_visible(&self, widget: W) -> bool
Is the widget visible.
Sourcepub fn render_block(&mut self)
👎Deprecated since 1.2.0: happens automatically
pub fn render_block(&mut self)
Render all visible blocks.
Sourcepub fn render_label<FN>(&mut self, widget: W, render_fn: FN) -> bool
pub fn render_label<FN>(&mut self, widget: W, render_fn: FN) -> bool
Render the label for the given widget.
Sourcepub fn render_widget<FN, WW>(&mut self, widget: W, render_fn: FN) -> bool
pub fn render_widget<FN, WW>(&mut self, widget: W, render_fn: FN) -> bool
Render a stateless widget and its label.
Sourcepub fn render<FN, WW, SS>(
&mut self,
widget: W,
render_fn: FN,
state: &mut SS,
) -> bool
pub fn render<FN, WW, SS>( &mut self, widget: W, render_fn: FN, state: &mut SS, ) -> bool
Render a stateful widget and its label.
Sourcepub fn locate_widget(&self, widget: W) -> Option<Rect>
pub fn locate_widget(&self, widget: W) -> Option<Rect>
Get the buffer coordinates for the given widget.
Sourcepub fn locate_label(&self, widget: W) -> Option<Rect>
pub fn locate_label(&self, widget: W) -> Option<Rect>
Get the buffer coordinates for the label of the given widget.
Sourcepub fn locate_area(&self, area: Rect) -> Option<Rect>
pub fn locate_area(&self, area: Rect) -> Option<Rect>
Relocate the area from layout coordinates to buffer coordinates, which is a noop as those are aligned.
But this will return None if the given area is outside the buffer.
Sourcepub fn shift(&self) -> (i16, i16)
👎Deprecated since 1.2.0: will be made private
pub fn shift(&self) -> (i16, i16)
Calculate the necessary shift from layout to screen.
Sourcepub fn relocate<S>(&self, state: &mut S)where
S: RelocatableState,
👎Deprecated since 1.2.0: will be made private
pub fn relocate<S>(&self, state: &mut S)where
S: RelocatableState,
After rendering the widget to the buffer it may have stored areas in its state. These will be in buffer coordinates instead of screen coordinates.
Call this function to correct this after rendering.
👎Deprecated since 1.2.0: will be made private
If a widget is not rendered because it is out of the buffer area, it may still have left over areas in its state.
This uses the mechanism for relocate to zero them out.
pub fn finish(self, buffer: &mut Buffer, state: &mut ClipperState<W>)
Sourcepub fn into_widget(self) -> ClipperWidget<'a, W>
👎Deprecated since 1.2.0: use finish() instead
pub fn into_widget(self) -> ClipperWidget<'a, W>
Rendering the content is finished.
Convert to the output widget that can be rendered in the target area.
Trait Implementations§
Source§impl<'a, W> Debug for ClipperBuffer<'a, W>
impl<'a, W> Debug for ClipperBuffer<'a, W>
Auto Trait Implementations§
impl<'a, W> Freeze for ClipperBuffer<'a, W>
impl<'a, W> !RefUnwindSafe for ClipperBuffer<'a, W>
impl<'a, W> !Send for ClipperBuffer<'a, W>
impl<'a, W> !Sync for ClipperBuffer<'a, W>
impl<'a, W> Unpin for ClipperBuffer<'a, W>
impl<'a, W> !UnwindSafe for ClipperBuffer<'a, W>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more