pub struct StyledSurface<'s, 'a> { /* private fields */ }Expand description
A Surface with a Style bound in, returned by Surface::with_style.
Every draw call omits the style argument the underlying Surface method would otherwise
need, using the bound style instead. Reach back to the underlying surface (e.g. to call
Surface::print_line, whose per-span styles make a bound style meaningless) via
StyledSurface::surface.
Implementations§
Source§impl<'a> StyledSurface<'_, 'a>
impl<'a> StyledSurface<'_, 'a>
Sourcepub const fn surface(&mut self) -> &mut Surface<'a>
pub const fn surface(&mut self) -> &mut Surface<'a>
Borrows the underlying Surface directly, for calls that need an explicit style (e.g.
Surface::print_line) or a capability StyledSurface doesn’t expose.
Sourcepub fn put(&mut self, pos: impl Into<Pos<u16>>, ch: char)
pub fn put(&mut self, pos: impl Into<Pos<u16>>, ch: char)
Surface::put using this view’s bound style.
Sourcepub fn print(&mut self, pos: impl Into<Pos<u16>>, text: &str)
pub fn print(&mut self, pos: impl Into<Pos<u16>>, text: &str)
Surface::print using this view’s bound style.
Sourcepub fn fill_rect(&mut self, rect: Rect<u16>, ch: char)
pub fn fill_rect(&mut self, rect: Rect<u16>, ch: char)
Surface::fill_rect using this view’s bound style.
Sourcepub fn put_span<S>(
&mut self,
pos: impl Into<Pos<u16>>,
rows: &[S],
) -> Option<()>
pub fn put_span<S>( &mut self, pos: impl Into<Pos<u16>>, rows: &[S], ) -> Option<()>
Surface::put_span using this view’s bound style.
Sourcepub fn put_span_uniform(
&mut self,
pos: impl Into<Pos<u16>>,
size: impl Into<Size>,
anchor: char,
fill: char,
) -> Option<()>
pub fn put_span_uniform( &mut self, pos: impl Into<Pos<u16>>, size: impl Into<Size>, anchor: char, fill: char, ) -> Option<()>
Surface::put_span_uniform using this view’s bound style.
Sourcepub fn put_offset(
&mut self,
pos: impl Into<Pos<u16>>,
offset: impl Into<Offset>,
ch: char,
)
pub fn put_offset( &mut self, pos: impl Into<Pos<u16>>, offset: impl Into<Offset>, ch: char, )
Surface::put_offset using this view’s bound style.