pub struct RequestOptions { /* private fields */ }Expand description
Per-operation resource and cancellation controls.
Limits apply to each SQL statement independently. The deadline also bounds the lifetime of an explicit transaction session. Cancellation is observed before queued work starts, while a session is idle, between statements, and at bounded-query checkpoints.
Implementations§
Source§impl RequestOptions
impl RequestOptions
Sourcepub fn new(limits: QueryLimits) -> Self
pub fn new(limits: QueryLimits) -> Self
Build request options with explicit query limits.
Sourcepub fn with_cancellation(self, cancellation: CancellationToken) -> Self
pub fn with_cancellation(self, cancellation: CancellationToken) -> Self
Attach a token that another task may use to cancel this operation.
Sourcepub fn with_limits(self, limits: QueryLimits) -> Self
pub fn with_limits(self, limits: QueryLimits) -> Self
Replace the per-statement query limits.
Sourcepub const fn limits(&self) -> QueryLimits
pub const fn limits(&self) -> QueryLimits
The configured per-statement query limits.
Sourcepub fn cancellation(&self) -> &CancellationToken
pub fn cancellation(&self) -> &CancellationToken
The cooperative cancellation token for this request.
Trait Implementations§
Source§impl Clone for RequestOptions
impl Clone for RequestOptions
Source§impl Debug for RequestOptions
impl Debug for RequestOptions
Auto Trait Implementations§
impl Forget for RequestOptions
impl Freeze for RequestOptions
impl Move for RequestOptions
impl RefUnwindSafe for RequestOptions
impl Send for RequestOptions
impl Sync for RequestOptions
impl Unpin for RequestOptions
impl UnsafeUnpin for RequestOptions
impl UnwindSafe for RequestOptions
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
Mutably borrows from an owned value. Read more