pub struct IncrementalSessionManager { /* private fields */ }Implementations§
Source§impl IncrementalSessionManager
impl IncrementalSessionManager
Sourcepub fn new(default_width: usize, default_height: usize) -> Self
pub fn new(default_width: usize, default_height: usize) -> Self
Creates a session manager with default viewport dimensions for new sessions.
A minimum size of 1x1 is enforced.
Sourcepub fn session_count(&self) -> usize
pub fn session_count(&self) -> usize
Returns the number of tracked sessions.
Sourcepub fn ensure_session(&mut self, session_id: &str) -> &mut IncrementalRenderer
pub fn ensure_session(&mut self, session_id: &str) -> &mut IncrementalRenderer
Returns an existing session renderer, creating one with default size if missing.
Sourcepub fn ensure_session_with_size(
&mut self,
session_id: &str,
width: usize,
height: usize,
) -> &mut IncrementalRenderer
pub fn ensure_session_with_size( &mut self, session_id: &str, width: usize, height: usize, ) -> &mut IncrementalRenderer
Ensures a session exists and resizes it before returning it.
Sourcepub fn remove_session(&mut self, session_id: &str) -> bool
pub fn remove_session(&mut self, session_id: &str) -> bool
Removes a session and returns whether it existed.
Sourcepub fn clear_session(&mut self, session_id: &str) -> bool
pub fn clear_session(&mut self, session_id: &str) -> bool
Clears cached frame state for a session and returns whether it existed.
Sourcepub fn render_patch_for_session(
&mut self,
session_id: &str,
source: &[u8],
spans: &[StyledSpan],
) -> Result<String, RenderError>
pub fn render_patch_for_session( &mut self, session_id: &str, source: &[u8], spans: &[StyledSpan], ) -> Result<String, RenderError>
Produces a patch for a specific session based on its own prior state.
§Errors
Returns an error when span validation fails.
Sourcepub fn highlight_to_patch_for_session(
&mut self,
session_id: &str,
highlighter: &mut SpanHighlighter,
source: &[u8],
flavor: Grammar,
theme: &Theme,
) -> Result<String, RenderError>
pub fn highlight_to_patch_for_session( &mut self, session_id: &str, highlighter: &mut SpanHighlighter, source: &[u8], flavor: Grammar, theme: &Theme, ) -> Result<String, RenderError>
Runs highlight + theme resolution + patch generation for a specific session.
§Errors
Returns an error if highlighting fails or spans fail validation.
Trait Implementations§
Source§impl Clone for IncrementalSessionManager
impl Clone for IncrementalSessionManager
Source§fn clone(&self) -> IncrementalSessionManager
fn clone(&self) -> IncrementalSessionManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for IncrementalSessionManager
impl RefUnwindSafe for IncrementalSessionManager
impl Send for IncrementalSessionManager
impl Sync for IncrementalSessionManager
impl Unpin for IncrementalSessionManager
impl UnsafeUnpin for IncrementalSessionManager
impl UnwindSafe for IncrementalSessionManager
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