pub struct SourceText { /* private fields */ }Expand description
Source text.
Implementations§
Source§impl SourceText
impl SourceText
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Constructs a new, empty SourceText with at least the specified capacity.
Sourcepub fn cur_linear_position(&self) -> LinearPosition
pub fn cur_linear_position(&self) -> LinearPosition
Get current LinearPosition.
Sourcepub fn get_code_points_from_pos(&self, pos: LinearPosition) -> &[u16]
pub fn get_code_points_from_pos(&self, pos: LinearPosition) -> &[u16]
Get code points from pos to the current end.
Sourcepub fn get_code_points_from_span(&self, span: LinearSpan) -> &[u16]
pub fn get_code_points_from_span(&self, span: LinearSpan) -> &[u16]
Get code points within span.
Sourcepub fn remove_last_code_point(&mut self)
pub fn remove_last_code_point(&mut self)
Remove last code point.
Sourcepub fn collect_code_point(&mut self, cp: u32)
pub fn collect_code_point(&mut self, cp: u32)
Trait Implementations§
Source§impl Clone for SourceText
impl Clone for SourceText
Source§fn clone(&self) -> SourceText
fn clone(&self) -> SourceText
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SourceText
impl Debug for SourceText
Source§impl Default for SourceText
impl Default for SourceText
Source§impl<'de> Deserialize<'de> for SourceText
impl<'de> Deserialize<'de> for SourceText
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SourceText
impl RefUnwindSafe for SourceText
impl Send for SourceText
impl Sync for SourceText
impl Unpin for SourceText
impl UnsafeUnpin for SourceText
impl UnwindSafe for SourceText
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