pub enum Connection<S: Schema> {
Direct(Database<S>),
Proxy(ProxyDatabase<S>),
}Expand description
A schema-bound connection opened by crate::SchemaPackage::connect.
Queries behave the same on both variants. Match on the variant only for
what one of them alone offers, such as CRUD managers on a direct
Database.
Variants§
Implementations§
Source§impl<S: Schema> Connection<S>
impl<S: Schema> Connection<S>
Sourcepub fn query(&self) -> Result<QuerySession<'_, S>>
pub fn query(&self) -> Result<QuerySession<'_, S>>
Start one query session under this connection’s answer-limit ceiling.
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.
Trait Implementations§
Auto Trait Implementations§
impl<S> !RefUnwindSafe for Connection<S>
impl<S> !UnwindSafe for Connection<S>
impl<S> Freeze for Connection<S>
impl<S> Send for Connection<S>
impl<S> Sync for Connection<S>
impl<S> Unpin for Connection<S>
impl<S> UnsafeUnpin for Connection<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
Mutably borrows from an owned value. Read more
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> ⓘ
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 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> ⓘ
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 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>
Wrap the input message
T in a tonic::Request