pub struct Grid {
pub width: u16,
pub height: u16,
/* private fields */
}Fields§
§width: u16§height: u16Implementations§
Source§impl Grid
impl Grid
pub fn new(width: u16, height: u16) -> Self
pub fn clear(&mut self)
pub fn get(&self, x: u16, y: u16) -> Option<&Cell>
pub fn set(&mut self, x: u16, y: u16, cell: Cell)
pub fn idx(&self, x: u16, y: u16) -> Option<usize>
Sourcepub fn put_text(
&mut self,
x: u16,
y: u16,
text: &str,
style: Style,
reg: &GlyphRegistry,
) -> u16
pub fn put_text( &mut self, x: u16, y: u16, text: &str, style: Style, reg: &GlyphRegistry, ) -> u16
Places text starting at (x, y) using the registry for width policy.
This function is newline-agnostic: \n will stop placement.
Returns the next x position after the last placed glyph.
pub fn rows(&self) -> impl Iterator<Item = &[Cell]>
Source§impl Grid
impl Grid
Sourcepub fn validate_invariants(
&self,
reg: &GlyphRegistry,
) -> Result<(), InvariantError>
pub fn validate_invariants( &self, reg: &GlyphRegistry, ) -> Result<(), InvariantError>
Validate internal grid invariants.
This is intended for tests and debug builds. Production callers can
enable it via the debug-validate feature.
Trait Implementations§
impl Eq for Grid
impl StructuralPartialEq for Grid
Auto Trait Implementations§
impl Freeze for Grid
impl RefUnwindSafe for Grid
impl Send for Grid
impl Sync for Grid
impl Unpin for Grid
impl UnsafeUnpin for Grid
impl UnwindSafe for Grid
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