pub struct StyledBuffer { /* private fields */ }Implementations§
Source§impl StyledBuffer
impl StyledBuffer
pub fn new() -> Self
pub fn from(text: impl Into<String>) -> Self
pub fn from_parts(text: TextBuffer, spans: Vec<StyledSpan>) -> Self
pub fn text(&self) -> &TextBuffer
pub fn text_mut(&mut self) -> &mut TextBuffer
pub fn spans(&self) -> &[StyledSpan]
pub fn len_bytes(&self) -> usize
pub fn len_chars(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn to_string(&self) -> String
pub fn snap(&self, offset: usize) -> usize
pub fn lines(&self) -> &LineIndex
pub fn substring(&self, range: Range<usize>) -> String
pub fn insert(&mut self, pos: usize, text: &str, attr: Option<SpanAttr>)
pub fn delete(&mut self, range: Range<usize>) -> (String, Vec<StyledSpan>)
pub fn replace( &mut self, range: Range<usize>, text: &str, attr: Option<SpanAttr>, ) -> (String, Vec<StyledSpan>)
pub fn set_attr(&mut self, range: Range<usize>, attr: SpanAttr)
pub fn clear_attr(&mut self, range: Range<usize>)
pub fn spans_for_line(&self, line_range: Range<usize>) -> Vec<StyledSpan>
pub fn apply_attr_range(&mut self, range: Range<usize>, spans: &[StyledSpan])
pub fn replace_spans(&mut self, spans: Vec<StyledSpan>)
Trait Implementations§
Source§impl Clone for StyledBuffer
impl Clone for StyledBuffer
Source§impl Debug for StyledBuffer
impl Debug for StyledBuffer
Auto Trait Implementations§
impl Freeze for StyledBuffer
impl RefUnwindSafe for StyledBuffer
impl Send for StyledBuffer
impl Sync for StyledBuffer
impl Unpin for StyledBuffer
impl UnsafeUnpin for StyledBuffer
impl UnwindSafe for StyledBuffer
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