Struct typedb_driver::Options
source · pub struct Options {
pub infer: Option<bool>,
pub trace_inference: Option<bool>,
pub explain: Option<bool>,
pub parallel: Option<bool>,
pub prefetch: Option<bool>,
pub prefetch_size: Option<i32>,
pub session_idle_timeout: Option<Duration>,
pub transaction_timeout: Option<Duration>,
pub schema_lock_acquire_timeout: Option<Duration>,
pub read_any_replica: Option<bool>,
}
Expand description
TypeDB session and transaction options.
TypeDBOptions
object can be used to override the default server behaviour.
Options are specified using properties assignment.
§Examples
let options = Options::new().infer(true).explain(true);
Fields§
§infer: Option<bool>
If set to True
, enables inference for queries. Only settable at transaction level and above. Only affects read transactions.
trace_inference: Option<bool>
If set to True
, reasoning tracing graphs are output in the logging directory. Should be used with parallel = False
.
explain: Option<bool>
If set to True
, enables explanations for queries. Only affects read transactions.
parallel: Option<bool>
If set to True
, the server uses parallel instead of single-threaded execution.
prefetch: Option<bool>
If set to True
, the first batch of answers is streamed to the driver even without an explicit request for it.
prefetch_size: Option<i32>
If set, specifies a guideline number of answers that the server should send before the driver issues a fresh request.
session_idle_timeout: Option<Duration>
If set, specifies a timeout that allows the server to close sessions if the driver terminates or becomes unresponsive.
transaction_timeout: Option<Duration>
If set, specifies a timeout for killing transactions automatically, preventing memory leaks in unclosed transactions.
schema_lock_acquire_timeout: Option<Duration>
If set, specifies how long the driver should wait if opening a session or transaction is blocked by a schema write lock.
read_any_replica: Option<bool>
If set to True
, enables reading data from any replica, potentially boosting read throughput. Only settable in TypeDB Cloud.
Implementations§
source§impl Options
impl Options
pub fn new() -> Self
sourcepub fn infer(self, infer: bool) -> Self
pub fn infer(self, infer: bool) -> Self
If set to True
, enables inference for queries. Only settable at transaction level and above. Only affects read transactions.
sourcepub fn trace_inference(self, trace_inference: bool) -> Self
pub fn trace_inference(self, trace_inference: bool) -> Self
If set to True
, reasoning tracing graphs are output in the logging directory. Should be used with parallel = False
.
sourcepub fn explain(self, explain: bool) -> Self
pub fn explain(self, explain: bool) -> Self
If set to True
, enables explanations for queries. Only affects read transactions.
sourcepub fn parallel(self, parallel: bool) -> Self
pub fn parallel(self, parallel: bool) -> Self
If set to True
, the server uses parallel instead of single-threaded execution.
sourcepub fn prefetch(self, prefetch: bool) -> Self
pub fn prefetch(self, prefetch: bool) -> Self
If set to True
, the first batch of answers is streamed to the driver even without an explicit request for it.
sourcepub fn prefetch_size(self, prefetch_size: i32) -> Self
pub fn prefetch_size(self, prefetch_size: i32) -> Self
If set, specifies a guideline number of answers that the server should send before the driver issues a fresh request.
sourcepub fn session_idle_timeout(self, timeout: Duration) -> Self
pub fn session_idle_timeout(self, timeout: Duration) -> Self
If set, specifies a timeout that allows the server to close sessions if the driver terminates or becomes unresponsive.
sourcepub fn transaction_timeout(self, timeout: Duration) -> Self
pub fn transaction_timeout(self, timeout: Duration) -> Self
If set, specifies a timeout for killing transactions automatically, preventing memory leaks in unclosed transactions.
sourcepub fn schema_lock_acquire_timeout(self, timeout: Duration) -> Self
pub fn schema_lock_acquire_timeout(self, timeout: Duration) -> Self
If set, specifies how long the driver should wait if opening a session or transaction is blocked by a schema write lock.
sourcepub fn read_any_replica(self, read_any_replica: bool) -> Self
pub fn read_any_replica(self, read_any_replica: bool) -> Self
If set to True
, enables reading data from any replica, potentially boosting read throughput. Only settable in TypeDB Cloud.
Trait Implementations§
impl Copy for Options
Auto Trait Implementations§
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnwindSafe for Options
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§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