pub enum SessionHandlerKey {
Empty,
}Expand description
Typed key for session handler lookup.
This enum defines the purposes for which session handlers can be registered.
Currently only Empty is supported for handling sessions without buffers.
§Compile-Time Safety
Using typed keys instead of strings ensures:
- Typos are caught at compile time (
SessionHandlerKey::Emtpy→ error) - Exhaustive matching in
matchstatements - Self-documenting API
§Example
ⓘ
use reovim_driver_session::{SessionHandlerKey, SessionHandlerRegistry, EmptySessionHandler};
use std::sync::Arc;
let registry = SessionHandlerRegistry::new();
registry.register(SessionHandlerKey::Empty, Arc::new(ScratchBufferHandler::new()));
// Lookup with typed key
let handler = registry.get(&SessionHandlerKey::Empty);Variants§
Empty
Handler for empty sessions (no buffers).
When a session starts with no files specified, this handler determines what to do (e.g., create a scratch buffer, show welcome).
Trait Implementations§
Source§impl Clone for SessionHandlerKey
impl Clone for SessionHandlerKey
Source§fn clone(&self) -> SessionHandlerKey
fn clone(&self) -> SessionHandlerKey
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 moreSource§impl Debug for SessionHandlerKey
impl Debug for SessionHandlerKey
Source§impl Hash for SessionHandlerKey
impl Hash for SessionHandlerKey
Source§impl PartialEq for SessionHandlerKey
impl PartialEq for SessionHandlerKey
Source§impl ServiceKey for SessionHandlerKey
impl ServiceKey for SessionHandlerKey
Source§fn service_name() -> &'static str
fn service_name() -> &'static str
Human-readable service name for error messages ONLY. Read more
impl Copy for SessionHandlerKey
impl Eq for SessionHandlerKey
impl StructuralPartialEq for SessionHandlerKey
Auto Trait Implementations§
impl Freeze for SessionHandlerKey
impl RefUnwindSafe for SessionHandlerKey
impl Send for SessionHandlerKey
impl Sync for SessionHandlerKey
impl Unpin for SessionHandlerKey
impl UnsafeUnpin for SessionHandlerKey
impl UnwindSafe for SessionHandlerKey
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