pub struct ProxyAwareSessionManager { /* private fields */ }Expand description
感知代理状态的 SessionManager
职责:
- 委托 LocalSessionManager 处理核心 session 逻辑
- 维护 session → backend_version 映射
- 在 resume 时检查版本一致性
- 版本不匹配时使 session 失效
Implementations§
Source§impl ProxyAwareSessionManager
impl ProxyAwareSessionManager
pub fn new(handler: Arc<ProxyHandler>) -> Self
Trait Implementations§
Source§impl SessionManager for ProxyAwareSessionManager
impl SessionManager for ProxyAwareSessionManager
type Error = LocalSessionManagerError
type Transport = WorkerTransport<LocalSessionWorker>
Source§async fn create_session(
&self,
) -> Result<(SessionId, Self::Transport), Self::Error>
async fn create_session( &self, ) -> Result<(SessionId, Self::Transport), Self::Error>
Create a new session with the given id and configuration.
async fn initialize_session( &self, id: &SessionId, message: ClientJsonRpcMessage, ) -> Result<ServerJsonRpcMessage, Self::Error>
async fn has_session(&self, id: &SessionId) -> Result<bool, Self::Error>
async fn close_session(&self, id: &SessionId) -> Result<(), Self::Error>
async fn create_stream( &self, id: &SessionId, message: ClientJsonRpcMessage, ) -> Result<impl Stream<Item = ServerSseMessage> + Send + 'static, Self::Error>
async fn accept_message( &self, id: &SessionId, message: ClientJsonRpcMessage, ) -> Result<(), Self::Error>
async fn create_standalone_stream( &self, id: &SessionId, ) -> Result<impl Stream<Item = ServerSseMessage> + Send + 'static, Self::Error>
async fn resume( &self, id: &SessionId, last_event_id: String, ) -> Result<impl Stream<Item = ServerSseMessage> + Send + 'static, Self::Error>
Auto Trait Implementations§
impl !Freeze for ProxyAwareSessionManager
impl !RefUnwindSafe for ProxyAwareSessionManager
impl Send for ProxyAwareSessionManager
impl Sync for ProxyAwareSessionManager
impl Unpin for ProxyAwareSessionManager
impl !UnwindSafe for ProxyAwareSessionManager
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