pub struct PgPoolRouter { /* private fields */ }Expand description
Immutable server-owned entity-to-pool routing table.
Implementations§
Source§impl PgPoolRouter
impl PgPoolRouter
pub fn new(default: Pool<Postgres>) -> PgPoolRouter
pub fn with_searcher(default: PgSiftQuery) -> PgPoolRouter
pub fn register_entity<E>(self, searcher: PgSiftQuery) -> PgPoolRouterwhere
E: SearchEntity,
pub fn register_pool<E>(self, pool: Pool<Postgres>) -> PgPoolRouterwhere
E: SearchEntity,
Sourcepub fn register_named(
self,
name: &str,
searcher: PgSiftQuery,
) -> Result<PgPoolRouter, PoolRouteError>
pub fn register_named( self, name: &str, searcher: PgSiftQuery, ) -> Result<PgPoolRouter, PoolRouteError>
Names are stable configuration labels, never tenant/user identifiers.
pub fn route_entity<E>(self, name: &str) -> Result<PgPoolRouter, PoolRouteError>where
E: SearchEntity,
pub fn with_default_named( self, name: &str, ) -> Result<PgPoolRouter, PoolRouteError>
Sourcepub fn searcher<E>(&self) -> Result<Arc<PgSiftQuery>, PoolRouteError>where
E: SearchEntity,
pub fn searcher<E>(&self) -> Result<Arc<PgSiftQuery>, PoolRouteError>where
E: SearchEntity,
Selected searcher exposes normal query, scan and export entry points.
pub fn searcher_with_context<E, C>(
&self,
context: &C,
selector: &impl PgPoolSelector<C>,
) -> Result<Arc<PgSiftQuery>, PoolRouteError>where
E: SearchEntity,
pub async fn search_map<E>(
&self,
query: impl QueryInput<E>,
scope: &ServerScope<E>,
) -> Result<Page<IndexMap<String, RowValue>>, PoolRouteError>where
E: SearchEntity,
pub async fn search_with_context<E, C>( &self, query: impl QueryInput<E>, scope: &ServerScope<E>, context: &C, selector: &impl PgPoolSelector<C>, ) -> Result<Page<E>, PoolRouteError>
pub async fn search_map_with_context<E, C>(
&self,
query: impl QueryInput<E>,
scope: &ServerScope<E>,
context: &C,
selector: &impl PgPoolSelector<C>,
) -> Result<Page<IndexMap<String, RowValue>>, PoolRouteError>where
E: SearchEntity,
pub async fn search<E>( &self, query: impl QueryInput<E>, scope: &ServerScope<E>, ) -> Result<Page<E>, PoolRouteError>
Trait Implementations§
Source§impl Clone for PgPoolRouter
impl Clone for PgPoolRouter
Source§fn clone(&self) -> PgPoolRouter
fn clone(&self) -> PgPoolRouter
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PgPoolRouter
impl Debug for PgPoolRouter
Source§impl Default for PgPoolRouter
impl Default for PgPoolRouter
Source§fn default() -> PgPoolRouter
fn default() -> PgPoolRouter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for PgPoolRouter
impl !UnwindSafe for PgPoolRouter
impl Freeze for PgPoolRouter
impl Send for PgPoolRouter
impl Sync for PgPoolRouter
impl Unpin for PgPoolRouter
impl UnsafeUnpin for PgPoolRouter
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> 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> ⓘ
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 more