reifydb_client/ws/session/
mod.rs

1// Copyright (c) reifydb.com 2025
2// This file is licensed under the MIT
3
4mod blocking;
5mod callback;
6mod channel;
7
8use std::time::Instant;
9
10pub use blocking::BlockingSession;
11pub use callback::CallbackSession;
12pub use channel::ChannelSession;
13use reifydb_type::Error;
14
15// Re-export common types from session module
16pub use crate::session::{CommandResult, QueryResult};
17
18/// Channel response enum for different response types (WebSocket-specific)
19#[derive(Debug)]
20pub enum ChannelResponse {
21	/// Authentication response
22	Auth {
23		request_id: String,
24	},
25	/// Command execution response with frames
26	Command {
27		request_id: String,
28		result: CommandResult,
29	},
30	/// Query execution response with frames
31	Query {
32		request_id: String,
33		result: QueryResult,
34	},
35}
36
37/// Response message for channel sessions (WebSocket-specific)
38#[derive(Debug)]
39pub struct ResponseMessage {
40	pub request_id: String,
41	pub response: Result<ChannelResponse, Error>,
42	pub timestamp: Instant,
43}