Skip to main content

CallBuilder

Struct CallBuilder 

Source
pub struct CallBuilder<'a, K, S = ClientOneShot> { /* private fields */ }

Implementations§

Source§

impl<'a, K> CallBuilder<'a, K, ClientOneShot>

Source

pub fn with_implicit_session(self) -> Self

Execute with an empty session_id (server-side implicit session) instead of leasing from the driver pool.

Source§

impl<'a, K, S> CallBuilder<'a, K, S>

Source

pub fn param(self, name: impl Into<String>, value: impl Into<Value>) -> Self

Source

pub fn params(self, params: HashMap<String, Value>) -> Self

Source

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

Wall-clock limit for the call. Retries transient errors until this deadline when combined with .idempotent(true). Without .timeout(), retries continue until a non-retryable error.

For QueryStream the timeout bounds opening the gRPC stream and any retries; iterating result sets is not bounded by this value.

Inside retry_tx, per-call .timeout() is capped by the remaining retry_tx deadline.

Source

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

Source

pub fn collect_stats(self) -> Self

Source

pub fn with_commit(self, commit: bool) -> Self

Override auto-commit (commit_tx in Query Service TxControl).

One-shot defaults depend on Self::with_tx_mode: implicit mode relies on the server; explicit modes default to commit_tx: true. Interactive transactions default to commit_tx: false unless [Self::with_commit(true)] is set on the last query.

When using [Self::query] with with_commit(true) inside a transaction, you must fully drain the stream and call QueryStream::close — dropping the stream early cancels the gRPC call and does not commit.

Source

pub fn with_tx_mode(self, mode: TxMode) -> Self

Set transaction isolation for this call.

Default on [QueryClient] is TxMode::Implicit (no tx_control; the server infers isolation from the SQL). Interactive transactions use the mode from [TransactionOptions] unless overridden here.

TxMode::Implicit inside [Transaction] returns a runtime error — DDL and other non-transactional statements must run on [QueryClient], not inside a transaction.

Source

pub fn implicit_tx(self) -> Self

Shorthand for Self::with_tx_mode (ImplicitTx / NoTx).

TxMode::Implicit inside [Transaction] returns a runtime error — DDL and other non-transactional statements must run on [QueryClient], not inside a transaction.

Source§

impl<'a, T, S> CallBuilder<'a, OneRow<T>, S>

Source

pub fn typed<U: FromYdbRow>(self) -> CallBuilder<'a, OneRow<U>, S>

Source

pub fn optional(self) -> CallBuilder<'a, OptionalRow<T>, S>

Trait Implementations§

Source§

impl<'a, S> IntoFuture for CallBuilder<'a, ExecCall, S>

Source§

type Output = Result<(), YdbError>

The output that the future will produce on completion.
Source§

type IntoFuture = Pin<Box<dyn Future<Output = <CallBuilder<'a, ExecCall, S> as IntoFuture>::Output> + Send + 'a>>

Which kind of future are we turning this into?
Source§

fn into_future(self) -> Self::IntoFuture

Creates a future from a value. Read more
Source§

impl<'a, T: FromYdbRow + 'a, S> IntoFuture for CallBuilder<'a, OneRow<T>, S>

Source§

type Output = Result<T, YdbError>

The output that the future will produce on completion.
Source§

type IntoFuture = Pin<Box<dyn Future<Output = <CallBuilder<'a, OneRow<T>, S> as IntoFuture>::Output> + Send + 'a>>

Which kind of future are we turning this into?
Source§

fn into_future(self) -> Self::IntoFuture

Creates a future from a value. Read more
Source§

impl<'a, T: FromYdbRow + 'a, S> IntoFuture for CallBuilder<'a, OptionalRow<T>, S>

Source§

type Output = Result<Option<T>, YdbError>

The output that the future will produce on completion.
Source§

type IntoFuture = Pin<Box<dyn Future<Output = <CallBuilder<'a, OptionalRow<T>, S> as IntoFuture>::Output> + Send + 'a>>

Which kind of future are we turning this into?
Source§

fn into_future(self) -> Self::IntoFuture

Creates a future from a value. Read more
Source§

impl<'a, S> IntoFuture for CallBuilder<'a, OneResultSet, S>

Source§

type Output = Result<ResultSet, YdbError>

The output that the future will produce on completion.
Source§

type IntoFuture = Pin<Box<dyn Future<Output = <CallBuilder<'a, OneResultSet, S> as IntoFuture>::Output> + Send + 'a>>

Which kind of future are we turning this into?
Source§

fn into_future(self) -> Self::IntoFuture

Creates a future from a value. Read more
Source§

impl<'a, S> IntoFuture for CallBuilder<'a, Streamed, S>

Source§

type Output = Result<QueryStream<'a>, YdbError>

The output that the future will produce on completion.
Source§

type IntoFuture = Pin<Box<dyn Future<Output = <CallBuilder<'a, Streamed, S> as IntoFuture>::Output> + Send + 'a>>

Which kind of future are we turning this into?
Source§

fn into_future(self) -> Self::IntoFuture

Creates a future from a value. Read more

Auto Trait Implementations§

§

impl<'a, K, S = ClientOneShot> !RefUnwindSafe for CallBuilder<'a, K, S>

§

impl<'a, K, S = ClientOneShot> !UnwindSafe for CallBuilder<'a, K, S>

§

impl<'a, K, S> Freeze for CallBuilder<'a, K, S>

§

impl<'a, K, S> Send for CallBuilder<'a, K, S>
where S: Send,

§

impl<'a, K, S> Sync for CallBuilder<'a, K, S>
where S: Sync,

§

impl<'a, K, S> Unpin for CallBuilder<'a, K, S>
where S: Unpin,

§

impl<'a, K, S> UnsafeUnpin for CallBuilder<'a, K, S>

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> Any for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Source§

fn type_name(&self) -> &'static str

Source§

impl<T> AnySync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

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> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

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

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

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

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

Source§

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>,

Source§

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.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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