Struct termwiz::cellcluster::CellCluster
source · [−]pub struct CellCluster {
pub attrs: CellAttributes,
pub text: String,
pub width: usize,
pub presentation: Presentation,
pub direction: Direction,
pub first_cell_idx: usize,
/* private fields */
}
Expand description
A CellCluster
is another representation of a Line.
A Vec<CellCluster>
is produced by walking through the Cells in
a line and collecting succesive Cells with the same attributes
together into a CellCluster
instance. Additional metadata to
aid in font rendering is also collected.
Fields
attrs: CellAttributes
text: String
width: usize
presentation: Presentation
direction: Direction
first_cell_idx: usize
Implementations
sourceimpl CellCluster
impl CellCluster
sourcepub fn byte_to_cell_idx(&self, byte_idx: usize) -> usize
pub fn byte_to_cell_idx(&self, byte_idx: usize) -> usize
Given a byte index into self.text
, return the corresponding
cell index in the originating line.
pub fn byte_to_cell_width(&self, byte_idx: usize) -> u8
sourcepub fn make_cluster<'a>(
hint: usize,
iter: impl Iterator<Item = CellRef<'a>>,
bidi_hint: Option<ParagraphDirectionHint>
) -> Vec<CellCluster>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn make_cluster<'a>(
hint: usize,
iter: impl Iterator<Item = CellRef<'a>>,
bidi_hint: Option<ParagraphDirectionHint>
) -> Vec<CellCluster>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Compute the list of CellClusters from a set of visible cells.
The input is typically the result of calling Line::visible_cells()
.
Trait Implementations
sourceimpl Clone for CellCluster
impl Clone for CellCluster
sourcefn clone(&self) -> CellCluster
fn clone(&self) -> CellCluster
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for CellCluster
impl Send for CellCluster
impl Sync for CellCluster
impl Unpin for CellCluster
impl UnwindSafe for CellCluster
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more