pub struct ProxyDatabase<S: Schema = Unbound> { /* private fields */ }Expand description
A proxy connection branded by schema S. Each generated query terminal
is one exchange with the server; a staged ProxyDatabase::transaction
sends its whole stack as one signed query-remote/v3 exchange at commit.
Implementations§
Source§impl ProxyDatabase<Unbound>
impl ProxyDatabase<Unbound>
Sourcepub async fn connect(options: ProxyConnectionPolicy) -> Result<Self>
pub async fn connect(options: ProxyConnectionPolicy) -> Result<Self>
Open the route and fetch the executor’s advertisement, unless one is pinned, then validate it.
Sourcepub async fn connect_with_cancellation(
options: ProxyConnectionPolicy,
cancellation: AnswerCancellation,
) -> Result<Self>
pub async fn connect_with_cancellation( options: ProxyConnectionPolicy, cancellation: AnswerCancellation, ) -> Result<Self>
Self::connect with a cancellation owner for the advertisement
fetch.
Sourcepub fn with_schema<S: Schema>(
self,
schema: SchemaPackage<S>,
) -> Result<ProxyDatabase<S>>
pub fn with_schema<S: Schema>( self, schema: SchemaPackage<S>, ) -> Result<ProxyDatabase<S>>
Verify and bind one generated schema package and its remote authority.
Source§impl<S: Schema> ProxyDatabase<S>
impl<S: Schema> ProxyDatabase<S>
Sourcepub async fn transaction(
&self,
options: TransactionOptions,
) -> Result<Transaction<S>>
pub async fn transaction( &self, options: TransactionOptions, ) -> Result<Transaction<S>>
Open a staged transaction over this proxy.
It has the same API as a direct
Database::transaction: stage
queues Plans, and commit sends them as one
signed query-remote/v3 envelope with a fresh nonce and verifies the
signed reply. A lost reply is commit_outcome_unknown: the stack may
have applied, and the caller reads the database. The staged advertisement is
pinned on the policy, or fetched on first use and verified against
the connection’s executor and reply key, then reused; nothing else is
sent until commit.
§Errors
Returns an error before ProxyDatabase::with_schema, or when the
staged advertisement cannot be fetched or decoded.
Sourcepub fn query(&self) -> Result<QuerySession<'_, S>>
pub fn query(&self) -> Result<QuerySession<'_, S>>
Start one owner-branded query session over this proxy connection.
Sourcepub fn query_with_resources(
&self,
resources: QueryExecutionResourceLimits,
cancellation: AnswerCancellation,
) -> Result<QuerySession<'_, S>>
pub fn query_with_resources( &self, resources: QueryExecutionResourceLimits, cancellation: AnswerCancellation, ) -> Result<QuerySession<'_, S>>
Start one query session whose resources are resources constrained
by this connection’s answer-limit ceiling, with a caller-owned
cancellation signal.
Trait Implementations§
Auto Trait Implementations§
impl<S = Unbound> !RefUnwindSafe for ProxyDatabase<S>
impl<S = Unbound> !UnwindSafe for ProxyDatabase<S>
impl<S> Freeze for ProxyDatabase<S>
impl<S> Send for ProxyDatabase<S>
impl<S> Sync for ProxyDatabase<S>
impl<S> Unpin for ProxyDatabase<S>
impl<S> UnsafeUnpin for ProxyDatabase<S>
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> 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