pub struct Canvas { /* private fields */ }
Expand description
§Canvas
The Canvas widget may be used to draw more detailed figures using braille patterns (each cell can have a braille character in 8 different positions).
Implementations§
Source§impl Canvas
impl Canvas
pub fn foreground(self, fg: Color) -> Self
pub fn background(self, bg: Color) -> Self
pub fn borders(self, b: Borders) -> Self
pub fn title<S: Into<String>>(self, t: S, a: Alignment) -> Self
pub fn data(self, data: &[Shape]) -> Self
Sourcepub fn x_bounds(self, bounds: (f64, f64)) -> Self
pub fn x_bounds(self, bounds: (f64, f64)) -> Self
From https://github.com/fdehau/tui-rs/issues/286:
Those are used to define the viewport of the canvas. Only the points whose coordinates are within the viewport are displayed. When you render the canvas using Frame::render_widget, you give an area to draw the widget to (a Rect) and the crate translates the floating point coordinates to those used by our internal terminal representation.
Sourcepub fn y_bounds(self, bounds: (f64, f64)) -> Self
pub fn y_bounds(self, bounds: (f64, f64)) -> Self
From https://github.com/fdehau/tui-rs/issues/286:
Those are used to define the viewport of the canvas. Only the points whose coordinates are within the viewport are displayed. When you render the canvas using Frame::render_widget, you give an area to draw the widget to (a Rect) and the crate translates the floating point coordinates to those used by our internal terminal representation.
Trait Implementations§
Source§impl MockComponent for Canvas
impl MockComponent for Canvas
Source§fn view(&mut self, render: &mut Frame<'_>, area: Rect)
fn view(&mut self, render: &mut Frame<'_>, area: Rect)
Source§fn query(&self, attr: Attribute) -> Option<AttrValue>
fn query(&self, attr: Attribute) -> Option<AttrValue>
Auto Trait Implementations§
impl Freeze for Canvas
impl RefUnwindSafe for Canvas
impl Send for Canvas
impl Sync for Canvas
impl Unpin for Canvas
impl UnwindSafe for Canvas
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