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: PgPool) -> Self
pub fn with_searcher(default: PgSiftQuery) -> Self
pub fn register_entity<E: SearchEntity>(self, searcher: PgSiftQuery) -> Self
pub fn register_pool<E: SearchEntity>(self, pool: PgPool) -> Self
Sourcepub fn register_named(
self,
name: &str,
searcher: PgSiftQuery,
) -> Result<Self, PoolRouteError>
pub fn register_named( self, name: &str, searcher: PgSiftQuery, ) -> Result<Self, PoolRouteError>
Names are stable configuration labels, never tenant/user identifiers.
pub fn route_entity<E: SearchEntity>( self, name: &str, ) -> Result<Self, PoolRouteError>
pub fn with_default_named(self, name: &str) -> Result<Self, PoolRouteError>
Sourcepub fn searcher<E: SearchEntity>(
&self,
) -> Result<Arc<PgSiftQuery>, PoolRouteError>
pub fn searcher<E: SearchEntity>( &self, ) -> Result<Arc<PgSiftQuery>, PoolRouteError>
Selected searcher exposes normal query, scan and export entry points.
pub fn searcher_with_context<E: SearchEntity, C>( &self, context: &C, selector: &impl PgPoolSelector<C>, ) -> Result<Arc<PgSiftQuery>, PoolRouteError>
pub async fn search_map<E: SearchEntity>( &self, query: impl QueryInput<E>, scope: &ServerScope<E>, ) -> Result<Page<RowMap>, PoolRouteError>
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: SearchEntity, C>( &self, query: impl QueryInput<E>, scope: &ServerScope<E>, context: &C, selector: &impl PgPoolSelector<C>, ) -> Result<Page<RowMap>, PoolRouteError>
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§impl Debug for PgPoolRouter
impl Debug for PgPoolRouter
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