Struct language2::TextBuffer
source · pub struct TextBuffer {
pub lamport_clock: Lamport,
/* private fields */
}
Fields§
§lamport_clock: Lamport
Implementations§
source§impl Buffer
impl Buffer
pub fn new(replica_id: u16, remote_id: u64, base_text: String) -> Buffer
pub fn version(&self) -> Global
pub fn snapshot(&self) -> BufferSnapshot
pub fn replica_id(&self) -> u16
pub fn remote_id(&self) -> u64
pub fn deferred_ops_len(&self) -> usize
pub fn transaction_group_interval(&self) -> Duration
pub fn edit<R, I, S, T>(&mut self, edits: R) -> Operationwhere R: IntoIterator<IntoIter = I>, I: ExactSizeIterator<Item = (Range<S>, T)>, S: ToOffset, T: Into<Arc<str, Global>>,
pub fn set_line_ending(&mut self, line_ending: LineEnding)
pub fn apply_ops<I>(&mut self, ops: I) -> Result<(), Error>where I: IntoIterator<Item = Operation>,
pub fn peek_undo_stack(&self) -> Option<&HistoryEntry>
pub fn peek_redo_stack(&self) -> Option<&HistoryEntry>
pub fn start_transaction(&mut self) -> Option<Lamport>
pub fn start_transaction_at(&mut self, now: Instant) -> Option<Lamport>
pub fn end_transaction(&mut self) -> Option<(Lamport, Global)>
pub fn end_transaction_at(&mut self, now: Instant) -> Option<(Lamport, Global)>
pub fn finalize_last_transaction(&mut self) -> Option<&Transaction>
pub fn group_until_transaction(&mut self, transaction_id: Lamport)
pub fn base_text(&self) -> &Rope
pub fn operations(&self) -> &TreeMap<Lamport, Operation>
pub fn undo(&mut self) -> Option<(Lamport, Operation)>
pub fn undo_transaction(&mut self, transaction_id: Lamport) -> Option<Operation>
pub fn undo_to_transaction( &mut self, transaction_id: Lamport ) -> Vec<Operation, Global>
pub fn forget_transaction(&mut self, transaction_id: Lamport)
pub fn merge_transactions(&mut self, transaction: Lamport, destination: Lamport)
pub fn redo(&mut self) -> Option<(Lamport, Operation)>
pub fn redo_to_transaction( &mut self, transaction_id: Lamport ) -> Vec<Operation, Global>
pub fn push_transaction(&mut self, transaction: Transaction, now: Instant)
pub fn edited_ranges_for_transaction<D, 'a>( &'a self, transaction: &'a Transaction ) -> impl Iterator<Item = Range<D>> + 'awhere D: TextDimension,
pub fn subscribe(&mut self) -> Subscription
pub fn wait_for_edits( &mut self, edit_ids: impl IntoIterator<Item = Lamport> ) -> impl Future<Output = Result<(), Error>> + 'static
pub fn wait_for_anchors( &mut self, anchors: impl IntoIterator<Item = Anchor> ) -> impl Future<Output = Result<(), Error>> + 'static
pub fn wait_for_version( &mut self, version: Global ) -> impl Future<Output = Result<(), Error>>
pub fn give_up_waiting(&mut self)
Methods from Deref<Target = BufferSnapshot>§
pub fn as_rope(&self) -> &Rope
pub fn remote_id(&self) -> u64
pub fn replica_id(&self) -> u16
pub fn row_count(&self) -> u32
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn chars(&self) -> impl Iterator<Item = char>
pub fn chars_for_range<T>(&self, range: Range<T>) -> impl Iterator<Item = char>where T: ToOffset,
pub fn reversed_chars_for_range<T>( &self, range: Range<T> ) -> impl Iterator<Item = char>where T: ToOffset,
pub fn contains_str_at<T>(&self, position: T, needle: &str) -> boolwhere T: ToOffset,
pub fn common_prefix_at<T>(&self, position: T, needle: &str) -> Range<T>where T: ToOffset + TextDimension,
pub fn text(&self) -> String
pub fn line_ending(&self) -> LineEnding
pub fn deleted_text(&self) -> String
pub fn fragments(&self) -> impl Iterator<Item = &Fragment>
pub fn text_summary(&self) -> TextSummary
pub fn max_point(&self) -> Point
pub fn max_point_utf16(&self) -> PointUtf16
pub fn point_to_offset(&self, point: Point) -> usize
pub fn point_utf16_to_offset(&self, point: PointUtf16) -> usize
pub fn unclipped_point_utf16_to_offset( &self, point: Unclipped<PointUtf16> ) -> usize
pub fn unclipped_point_utf16_to_point( &self, point: Unclipped<PointUtf16> ) -> Point
pub fn offset_utf16_to_offset(&self, offset: OffsetUtf16) -> usize
pub fn offset_to_offset_utf16(&self, offset: usize) -> OffsetUtf16
pub fn offset_to_point(&self, offset: usize) -> Point
pub fn offset_to_point_utf16(&self, offset: usize) -> PointUtf16
pub fn point_to_point_utf16(&self, point: Point) -> PointUtf16
pub fn version(&self) -> &Global
pub fn chars_at<T>(&self, position: T) -> impl Iterator<Item = char>where T: ToOffset,
pub fn reversed_chars_at<T>(&self, position: T) -> impl Iterator<Item = char>where T: ToOffset,
pub fn reversed_chunks_in_range<T>(&self, range: Range<T>) -> Chunks<'_> ⓘwhere T: ToOffset,
pub fn bytes_in_range<T>(&self, range: Range<T>) -> Bytes<'_> ⓘwhere T: ToOffset,
pub fn reversed_bytes_in_range<T>(&self, range: Range<T>) -> Bytes<'_> ⓘwhere T: ToOffset,
pub fn text_for_range<T>(&self, range: Range<T>) -> Chunks<'_> ⓘwhere T: ToOffset,
pub fn line_len(&self, row: u32) -> u32
pub fn is_line_blank(&self, row: u32) -> bool
pub fn text_summary_for_range<D, O>(&self, range: Range<O>) -> Dwhere O: ToOffset, D: TextDimension,
pub fn summaries_for_anchors<'a, D, A>( &'a self, anchors: A ) -> impl Iterator<Item = D> + 'awhere D: 'a + TextDimension, A: 'a + IntoIterator<Item = &'a Anchor>,
pub fn summaries_for_anchors_with_payload<'a, D, A, T>( &'a self, anchors: A ) -> impl Iterator<Item = (D, T)> + 'awhere D: 'a + TextDimension, A: 'a + IntoIterator<Item = (&'a Anchor, T)>,
pub fn anchor_before<T>(&self, position: T) -> Anchorwhere T: ToOffset,
pub fn anchor_after<T>(&self, position: T) -> Anchorwhere T: ToOffset,
pub fn anchor_at<T>(&self, position: T, bias: Bias) -> Anchorwhere T: ToOffset,
pub fn can_resolve(&self, anchor: &Anchor) -> bool
pub fn clip_offset(&self, offset: usize, bias: Bias) -> usize
pub fn clip_point(&self, point: Point, bias: Bias) -> Point
pub fn clip_offset_utf16(&self, offset: OffsetUtf16, bias: Bias) -> OffsetUtf16
pub fn clip_point_utf16( &self, point: Unclipped<PointUtf16>, bias: Bias ) -> PointUtf16
pub fn edits_since<D, 'a>( &'a self, since: &'a Global ) -> impl Iterator<Item = Edit<D>> + 'awhere D: TextDimension + Ord,
pub fn anchored_edits_since<D, 'a>( &'a self, since: &'a Global ) -> impl Iterator<Item = (Edit<D>, Range<Anchor>)> + 'awhere D: TextDimension + Ord,
pub fn edits_since_in_range<D, 'a>( &'a self, since: &'a Global, range: Range<Anchor> ) -> impl Iterator<Item = Edit<D>> + 'awhere D: TextDimension + Ord,
pub fn anchored_edits_since_in_range<D, 'a>( &'a self, since: &'a Global, range: Range<Anchor> ) -> impl Iterator<Item = (Edit<D>, Range<Anchor>)> + 'awhere D: TextDimension + Ord,
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Buffer
impl Send for Buffer
impl Sync for Buffer
impl Unpin for Buffer
impl !UnwindSafe for Buffer
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