pub struct DrawContext<'a> { /* private fields */ }Expand description
A context for drawing on a canvas (character-based)
Implementations§
Source§impl<'a> DrawContext<'a>
impl<'a> DrawContext<'a>
Sourcepub fn set_styled(
&mut self,
x: u16,
y: u16,
ch: char,
fg: Option<Color>,
bg: Option<Color>,
)
pub fn set_styled( &mut self, x: u16, y: u16, ch: char, fg: Option<Color>, bg: Option<Color>, )
Set a character with style at position
Sourcepub fn hline(
&mut self,
x: u16,
y: u16,
length: u16,
ch: char,
fg: Option<Color>,
)
pub fn hline( &mut self, x: u16, y: u16, length: u16, ch: char, fg: Option<Color>, )
Draw a horizontal line
Sourcepub fn vline(
&mut self,
x: u16,
y: u16,
length: u16,
ch: char,
fg: Option<Color>,
)
pub fn vline( &mut self, x: u16, y: u16, length: u16, ch: char, fg: Option<Color>, )
Draw a vertical line
Sourcepub fn rect(
&mut self,
x: u16,
y: u16,
width: u16,
height: u16,
fg: Option<Color>,
)
pub fn rect( &mut self, x: u16, y: u16, width: u16, height: u16, fg: Option<Color>, )
Draw a rectangle outline
Sourcepub fn fill_rect(
&mut self,
rect: Rect,
ch: char,
fg: Option<Color>,
bg: Option<Color>,
)
pub fn fill_rect( &mut self, rect: Rect, ch: char, fg: Option<Color>, bg: Option<Color>, )
Fill a rectangle
Sourcepub fn bar(&mut self, x: u16, y: u16, width: u16, fg: Color, bg: Option<Color>)
pub fn bar(&mut self, x: u16, y: u16, width: u16, fg: Color, bg: Option<Color>)
Draw a filled bar (for Gantt charts, progress bars, etc.)
Sourcepub fn partial_bar(&mut self, x: u16, y: u16, width: f32, fg: Color)
pub fn partial_bar(&mut self, x: u16, y: u16, width: f32, fg: Color)
Draw a partial bar (for fractional values)
Auto Trait Implementations§
impl<'a> Freeze for DrawContext<'a>
impl<'a> RefUnwindSafe for DrawContext<'a>
impl<'a> Send for DrawContext<'a>
impl<'a> Sync for DrawContext<'a>
impl<'a> Unpin for DrawContext<'a>
impl<'a> !UnwindSafe for DrawContext<'a>
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