pub struct TypeDBRuntime { /* private fields */ }Expand description
Real TypeDB backend wrapping an internal band-tagged driver handle.
Implementations§
Source§impl TypeDBRuntime
impl TypeDBRuntime
Sourcepub fn force_close(&self) -> Result<()>
pub fn force_close(&self) -> Result<()>
Make the selected driver terminal and dispatch upstream shutdown.
Bindings call this at their public connection-close boundary instead of
relying on field drop ordering. While any transaction handle is retained,
close returns resource_in_use and leaves the connection available.
After those handles are released, the first call prevents new operations,
invalidates in-flight work through upstream shutdown, and
leaves the runtime permanently unavailable even if shutdown reports an
error. A later call retries incomplete upstream dispatch without
reopening the connection; calls after successful dispatch are harmless.
Final callback-worker release remains lease-aware and occurs when the
last driver handle drops.
Source§impl TypeDBRuntime
impl TypeDBRuntime
Sourcepub async fn connect(
address: &str,
username: &str,
password: &str,
options: ConnectOptions,
) -> Result<Self>
pub async fn connect( address: &str, username: &str, password: &str, options: ConnectOptions, ) -> Result<Self>
Connect to a TypeDB server.
Validates the supplied server version, or probes via HTTP before opening
any gRPC connection when no version is supplied.
Returns RuntimeError::UnsupportedVersion when the server is outside the
supported window or on a different protocol band than the driver.
Sourcepub async fn connect_secure(
address: &str,
username: &str,
password: &str,
options: SecureConnectOptions,
) -> SecureResult<Self>
pub async fn connect_secure( address: &str, username: &str, password: &str, options: SecureConnectOptions, ) -> SecureResult<Self>
Connect using an explicit typed TLS policy.
Custom trust material is validated before the HTTP version probe or any gRPC host is constructed. An enabled mode remains enabled through HTTP failure, driver-band discovery, and native-band upgrade.
Sourcepub fn server_version(&self) -> Option<Version>
pub fn server_version(&self) -> Option<Version>
The server version detected by the connect gate, when known.
When this is None, callers must use the negotiated driver band rather
than inferring a server version from a failed HTTP probe.
Sourcepub fn supports_given_rows(&self) -> bool
pub fn supports_given_rows(&self) -> bool
Return whether the connection actually negotiated a driver that can
transport given input rows.
This is deliberately separate from the reported server version. A
3.12 server may accept the band-8 discovery connection when a later
band-9 upgrade fails; advertising given in that state would select an
execution path the active driver cannot carry.
Source§impl TypeDBRuntime
impl TypeDBRuntime
Sourcepub fn open_transaction(
&self,
database: &str,
tx_type: TxType,
) -> BoxFuture<'_, Result<RuntimeTransaction>>
pub fn open_transaction( &self, database: &str, tx_type: TxType, ) -> BoxFuture<'_, Result<RuntimeTransaction>>
Open a TypeDB transaction against database.
Sourcepub fn open_transaction_with_timeout(
&self,
database: &str,
tx_type: TxType,
timeout: Duration,
) -> BoxFuture<'_, Result<RuntimeTransaction>>
pub fn open_transaction_with_timeout( &self, database: &str, tx_type: TxType, timeout: Duration, ) -> BoxFuture<'_, Result<RuntimeTransaction>>
Open a TypeDB transaction with an explicit server-side lifetime bound.
Higher layers use this for transactions that hold schema exclusion: a lost client must not leave the server-side fence unbounded while the transport is still detecting terminal closure.
Auto Trait Implementations§
impl !RefUnwindSafe for TypeDBRuntime
impl !UnwindSafe for TypeDBRuntime
impl Freeze for TypeDBRuntime
impl Send for TypeDBRuntime
impl Sync for TypeDBRuntime
impl Unpin for TypeDBRuntime
impl UnsafeUnpin for TypeDBRuntime
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request