Struct MemoryProxyDB
pub struct MemoryProxyDB { /* private fields */ }
Expand description
A fast in-memory ProxyDatabase that is the default choice for Rama.
Implementations§
§impl MemoryProxyDB
impl MemoryProxyDB
pub fn try_from_rows(
proxies: Vec<Proxy>,
) -> Result<MemoryProxyDB, MemoryProxyDBInsertError>
pub fn try_from_rows( proxies: Vec<Proxy>, ) -> Result<MemoryProxyDB, MemoryProxyDBInsertError>
Create a new in-memory proxy database with the given proxies.
pub fn try_from_iter<I>(
proxies: I,
) -> Result<MemoryProxyDB, MemoryProxyDBInsertError>where
I: IntoIterator<Item = Proxy>,
pub fn try_from_iter<I>(
proxies: I,
) -> Result<MemoryProxyDB, MemoryProxyDBInsertError>where
I: IntoIterator<Item = Proxy>,
Create a new in-memory proxy database with the given proxies from an iterator.
Trait Implementations§
§impl Debug for MemoryProxyDB
impl Debug for MemoryProxyDB
§impl ProxyDB for MemoryProxyDB
impl ProxyDB for MemoryProxyDB
§type Error = MemoryProxyDBQueryError
type Error = MemoryProxyDBQueryError
The error type that can be returned by the proxy database Read more
§async fn get_proxy_if(
&self,
ctx: ProxyContext,
filter: ProxyFilter,
predicate: impl ProxyQueryPredicate,
) -> Result<Proxy, <MemoryProxyDB as ProxyDB>::Error>
async fn get_proxy_if( &self, ctx: ProxyContext, filter: ProxyFilter, predicate: impl ProxyQueryPredicate, ) -> Result<Proxy, <MemoryProxyDB as ProxyDB>::Error>
Same as
Self::get_proxy
but with a predicate
to filter out found proxies that do not match the given predicate.§fn get_proxy(
&self,
ctx: ProxyContext,
filter: ProxyFilter,
) -> impl Future<Output = Result<Proxy, Self::Error>> + Send
fn get_proxy( &self, ctx: ProxyContext, filter: ProxyFilter, ) -> impl Future<Output = Result<Proxy, Self::Error>> + Send
Get a
Proxy
based on the given ProxyContext
and ProxyFilter
,
or return an error in case no Proxy
could be returned.Auto Trait Implementations§
impl Freeze for MemoryProxyDB
impl RefUnwindSafe for MemoryProxyDB
impl Send for MemoryProxyDB
impl Sync for MemoryProxyDB
impl Unpin for MemoryProxyDB
impl UnwindSafe for MemoryProxyDB
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Create a new
Policy
that returns Action::Follow
only if self
and other
return
Action::Follow
. Read more