pub struct RouteChannelEngine { /* private fields */ }Expand description
A SurrealEngine that drives an engine which consumes Routes.
The WebSocket and HTTP engines each run a task that reads Routes off a
channel and answers on the response channel a Route carries – the
channel is also their session replay log, so a reconnection can rebuild
what the connection had established. This adapter is the whole of what it
takes to expose one of them through SurrealEngine: it turns each typed
call back into the Command that task already understands, and unwraps
the single response into the type the method promises.
Command is therefore an implementation detail of those two engines, not
part of the interface: an engine with no route channel – the embedded and
gRPC ones – never constructs a Command at all.
Implementations§
Source§impl RouteChannelEngine
impl RouteChannelEngine
Sourcepub fn new(sender: Sender<Route>) -> Self
pub fn new(sender: Sender<Route>) -> Self
Wraps a route sender as a SurrealEngine.
Trait Implementations§
Source§impl Clone for RouteChannelEngine
impl Clone for RouteChannelEngine
Source§impl Debug for RouteChannelEngine
impl Debug for RouteChannelEngine
Source§impl SurrealEngine for RouteChannelEngine
impl SurrealEngine for RouteChannelEngine
Source§fn query(
&self,
ctx: EngineContext,
query: Cow<'static, str>,
variables: Variables,
) -> EngineFuture<'_, Vec<QueryResult>>
fn query( &self, ctx: EngineContext, query: Cow<'static, str>, variables: Variables, ) -> EngineFuture<'_, Vec<QueryResult>>
Source§fn run(
&self,
ctx: EngineContext,
name: String,
version: Option<String>,
args: Array,
) -> EngineFuture<'_, Value>
fn run( &self, ctx: EngineContext, name: String, version: Option<String>, args: Array, ) -> EngineFuture<'_, Value>
version is set.Source§fn use_ns_db(
&self,
ctx: EngineContext,
namespace: Option<String>,
database: Option<String>,
) -> EngineFuture<'_, (Option<String>, Option<String>)>
fn use_ns_db( &self, ctx: EngineContext, namespace: Option<String>, database: Option<String>, ) -> EngineFuture<'_, (Option<String>, Option<String>)>
None for either argument leaves that one unchanged.Source§fn set(
&self,
ctx: EngineContext,
key: String,
value: Value,
) -> EngineFuture<'_, ()>
fn set( &self, ctx: EngineContext, key: String, value: Value, ) -> EngineFuture<'_, ()>
Source§fn unset(&self, ctx: EngineContext, key: String) -> EngineFuture<'_, ()>
fn unset(&self, ctx: EngineContext, key: String) -> EngineFuture<'_, ()>
Source§fn signup(
&self,
ctx: EngineContext,
credentials: Object,
) -> EngineFuture<'_, Token>
fn signup( &self, ctx: EngineContext, credentials: Object, ) -> EngineFuture<'_, Token>
Source§fn signin(
&self,
ctx: EngineContext,
credentials: Object,
) -> EngineFuture<'_, Token>
fn signin( &self, ctx: EngineContext, credentials: Object, ) -> EngineFuture<'_, Token>
Source§fn authenticate(
&self,
ctx: EngineContext,
token: Token,
) -> EngineFuture<'_, Token>
fn authenticate( &self, ctx: EngineContext, token: Token, ) -> EngineFuture<'_, Token>
Source§fn refresh(&self, ctx: EngineContext, token: Token) -> EngineFuture<'_, Token>
fn refresh(&self, ctx: EngineContext, token: Token) -> EngineFuture<'_, Token>
Source§fn revoke(&self, ctx: EngineContext, token: Token) -> EngineFuture<'_, ()>
fn revoke(&self, ctx: EngineContext, token: Token) -> EngineFuture<'_, ()>
Source§fn invalidate(&self, ctx: EngineContext) -> EngineFuture<'_, ()>
fn invalidate(&self, ctx: EngineContext) -> EngineFuture<'_, ()>
Source§fn begin(&self, ctx: EngineContext) -> EngineFuture<'_, Uuid>
fn begin(&self, ctx: EngineContext) -> EngineFuture<'_, Uuid>
Source§fn commit(&self, ctx: EngineContext, txn: Uuid) -> EngineFuture<'_, ()>
fn commit(&self, ctx: EngineContext, txn: Uuid) -> EngineFuture<'_, ()>
Source§fn rollback(&self, ctx: EngineContext, txn: Uuid) -> EngineFuture<'_, ()>
fn rollback(&self, ctx: EngineContext, txn: Uuid) -> EngineFuture<'_, ()>
Source§fn health(&self, ctx: EngineContext) -> EngineFuture<'_, ()>
fn health(&self, ctx: EngineContext) -> EngineFuture<'_, ()>
Source§fn version(&self, ctx: EngineContext) -> EngineFuture<'_, String>
fn version(&self, ctx: EngineContext) -> EngineFuture<'_, String>
surrealdb-3.0.0).Source§fn subscribe_live(
&self,
ctx: EngineContext,
uuid: Uuid,
notifications: Sender<Result<Notification, Error>>,
) -> EngineFuture<'_, ()>
fn subscribe_live( &self, ctx: EngineContext, uuid: Uuid, notifications: Sender<Result<Notification, Error>>, ) -> EngineFuture<'_, ()>
Source§fn kill(&self, ctx: EngineContext, uuid: Uuid) -> EngineFuture<'_, ()>
fn kill(&self, ctx: EngineContext, uuid: Uuid) -> EngineFuture<'_, ()>
Source§fn export_file(
&self,
ctx: EngineContext,
path: PathBuf,
config: Option<DbExportConfig>,
) -> EngineFuture<'_, ()>
fn export_file( &self, ctx: EngineContext, path: PathBuf, config: Option<DbExportConfig>, ) -> EngineFuture<'_, ()>
Source§fn export_bytes(
&self,
ctx: EngineContext,
bytes: Sender<Result<Vec<u8>, Error>>,
config: Option<DbExportConfig>,
) -> EngineFuture<'_, ()>
fn export_bytes( &self, ctx: EngineContext, bytes: Sender<Result<Vec<u8>, Error>>, config: Option<DbExportConfig>, ) -> EngineFuture<'_, ()>
Source§fn export_ml_file(
&self,
ctx: EngineContext,
path: PathBuf,
config: MlExportConfig,
) -> EngineFuture<'_, ()>
fn export_ml_file( &self, ctx: EngineContext, path: PathBuf, config: MlExportConfig, ) -> EngineFuture<'_, ()>
Source§fn export_ml_bytes(
&self,
ctx: EngineContext,
bytes: Sender<Result<Vec<u8>, Error>>,
config: MlExportConfig,
) -> EngineFuture<'_, ()>
fn export_ml_bytes( &self, ctx: EngineContext, bytes: Sender<Result<Vec<u8>, Error>>, config: MlExportConfig, ) -> EngineFuture<'_, ()>
Source§fn import_file(&self, ctx: EngineContext, path: PathBuf) -> EngineFuture<'_, ()>
fn import_file(&self, ctx: EngineContext, path: PathBuf) -> EngineFuture<'_, ()>
Source§fn import_ml_file(
&self,
ctx: EngineContext,
path: PathBuf,
) -> EngineFuture<'_, ()>
fn import_ml_file( &self, ctx: EngineContext, path: PathBuf, ) -> EngineFuture<'_, ()>
Source§fn query_stream(
&self,
ctx: EngineContext,
query: Cow<'static, str>,
variables: Variables,
items: Sender<QueryStreamItem>,
) -> EngineFuture<'_, ()>
fn query_stream( &self, ctx: EngineContext, query: Cow<'static, str>, variables: Variables, items: Sender<QueryStreamItem>, ) -> EngineFuture<'_, ()>
items as they are produced. Read more