pub struct Options {
pub parallel: Option<bool>,
pub prefetch: Option<bool>,
pub prefetch_size: Option<u64>,
pub transaction_timeout: Option<Duration>,
pub schema_lock_acquire_timeout: Option<Duration>,
pub read_any_replica: Option<bool>,
}
Expand description
TypeDB transaction options.
TypeDBOptions
object can be used to override the default server behaviour.
Options are specified using properties assignment.
§Examples
let options = Options::new().explain(true);
Fields§
§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<u64>
If set, specifies a guideline number of answers that the server should send before the driver issues a fresh request.
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 transaction is blocked by an exclusive 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 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: u64) -> Self
pub fn prefetch_size(self, prefetch_size: u64) -> Self
If set, specifies a guideline number of answers that the server should send before the driver issues a fresh request.
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 transaction is blocked by an exclusive 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 Freeze for Options
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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