pub struct EditorSession {
pub document: EditorDocument,
pub id: String,
pub last_accessed: Instant,
pub memory_usage: usize,
pub operation_count: usize,
pub metadata: HashMap<String, String>,
}Available on crate feature
std only.Expand description
A single editing session containing a document and associated state
Fields§
§document: EditorDocumentThe document being edited
id: StringSession identifier
last_accessed: InstantLast access timestamp for cleanup purposes
memory_usage: usizeMemory usage of this session
operation_count: usizeNumber of operations performed in this session
metadata: HashMap<String, String>Session-specific metadata
Implementations§
Source§impl EditorSession
impl EditorSession
Sourcepub fn new(id: String, document: EditorDocument) -> Self
pub fn new(id: String, document: EditorDocument) -> Self
Create a new session with a document
Sourcepub fn get_metadata(&self, key: &str) -> Option<&str>
pub fn get_metadata(&self, key: &str) -> Option<&str>
Get session metadata
Sourcepub fn set_metadata(&mut self, key: String, value: String)
pub fn set_metadata(&mut self, key: String, value: String)
Set session metadata
Sourcepub fn increment_operations(&mut self)
pub fn increment_operations(&mut self)
Increment operation counter
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for EditorSession
impl !RefUnwindSafe for EditorSession
impl Send for EditorSession
impl !Sync for EditorSession
impl Unpin for EditorSession
impl !UnwindSafe for EditorSession
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