pub struct ContextManager { /* private fields */ }Expand description
Context manager that caches computed contexts
Uses ArcSwap for lock-free reads during rendering.
Implementations§
Source§impl ContextManager
impl ContextManager
Sourcepub fn cursor_changed(&self, buffer_id: usize, line: u32, col: u32) -> bool
pub fn cursor_changed(&self, buffer_id: usize, line: u32, col: u32) -> bool
Check if cursor position changed
Returns true if position differs from last known position, or if never processed.
§Panics
Panics if the internal lock is poisoned.
Sourcepub fn update_cursor(&self, buffer_id: usize, line: u32, col: u32)
pub fn update_cursor(&self, buffer_id: usize, line: u32, col: u32)
Sourcepub fn viewport_changed(&self, buffer_id: usize, top_line: u32) -> bool
pub fn viewport_changed(&self, buffer_id: usize, top_line: u32) -> bool
Check if viewport top line changed
Returns true if position differs from last known position, or if never processed.
§Panics
Panics if the internal lock is poisoned.
Sourcepub fn update_viewport(&self, buffer_id: usize, top_line: u32)
pub fn update_viewport(&self, buffer_id: usize, top_line: u32)
Sourcepub fn set_cursor_context(&self, context: CachedContext)
pub fn set_cursor_context(&self, context: CachedContext)
Store cursor context
Sourcepub fn get_cursor_context(&self) -> Arc<Option<CachedContext>>
pub fn get_cursor_context(&self) -> Arc<Option<CachedContext>>
Get cursor context (lock-free read)
Sourcepub fn set_viewport_context(&self, context: CachedContext)
pub fn set_viewport_context(&self, context: CachedContext)
Store viewport context
Sourcepub fn get_viewport_context(&self) -> Arc<Option<CachedContext>>
pub fn get_viewport_context(&self) -> Arc<Option<CachedContext>>
Get viewport context (lock-free read)
Sourcepub fn invalidate_buffer(&self, buffer_id: usize)
pub fn invalidate_buffer(&self, buffer_id: usize)
Invalidate cache for a buffer (called on BufferModified)
§Panics
Panics if the internal lock is poisoned.
Sourcepub fn buffer_version(&self, buffer_id: usize) -> u64
pub fn buffer_version(&self, buffer_id: usize) -> u64
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ContextManager
impl RefUnwindSafe for ContextManager
impl Send for ContextManager
impl Sync for ContextManager
impl Unpin for ContextManager
impl UnwindSafe for ContextManager
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