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

source

pub fn new() -> Self

source

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.

source

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.

source

pub fn explain(self, explain: bool) -> Self

If set to True, enables explanations for queries. Only affects read transactions.

source

pub fn parallel(self, parallel: bool) -> Self

If set to True, the server uses parallel instead of single-threaded execution.

source

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.

source

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.

source

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.

source

pub fn transaction_timeout(self, timeout: Duration) -> Self

If set, specifies a timeout for killing transactions automatically, preventing memory leaks in unclosed transactions.

source

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.

source

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§

source§

impl Clone for Options

source§

fn clone(&self) -> Options

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Options

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Options

source§

fn default() -> Options

Returns the “default value” for a type. Read more
source§

impl Copy for Options

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more