Struct ProxyRuntimeColumn
pub struct ProxyRuntimeColumn { /* private fields */ }proxy only.Expand description
A set of proxies of one MemoryProxyDB that can be changed
while the database is in use, from any task and without a lock.
Created with MemoryProxyDB::new_exclude_column, whose proxies are never
selected, or MemoryProxyDB::new_require_column, which limits the selection
to its proxies. Every query of the database, including a lookup by
ProxyFilter::id, takes the column as it is at that moment into account.
The column holds on to the proxies of its database, so it can be used on its own,
e.g. once the database is handed to a ProxyDBLayer.
Clones are cheap and share the same proxies.
A column belongs to exactly one database. When that database is replaced,
e.g. in a live update, create a column for the new database and carry the
proxies over with ProxyRuntimeColumn::extend_from.
Implementations§
§impl ProxyRuntimeColumn
impl ProxyRuntimeColumn
pub fn insert(&self, id: &str) -> Option<bool>
pub fn insert(&self, id: &str) -> Option<bool>
Insert the proxy with the given id.
Returns None if the database has no proxy with that id,
otherwise Some(true) if this call inserted it and Some(false)
if it was already in the column. Of concurrent calls for the same proxy
only one gets Some(true), e.g. to make that caller the one that
schedules its removal.
pub fn remove(&self, id: &str) -> Option<bool>
pub fn remove(&self, id: &str) -> Option<bool>
Remove the proxy with the given id.
Returns None if the database has no proxy with that id,
otherwise whether it was in the column.
pub fn contains(&self, id: &str) -> bool
pub fn contains(&self, id: &str) -> bool
Returns true if the proxy with the given id is in the column.
pub fn clear(&self)
pub fn clear(&self)
Remove all proxies from the column.
pub fn extend_from(&self, other: &ProxyRuntimeColumn) -> usize
pub fn extend_from(&self, other: &ProxyRuntimeColumn) -> usize
Insert every proxy of other, typically a column of the database
this one replaces, that this column’s database also has.
Proxies are matched by id. Returns the number of proxies of other
found in this column’s database, all of which are in this column afterwards.
A proxy inserted in other after this call is not carried over: in a live update,
switch to the new column before LiveUpdateProxyDBSetter::set,
or run this again afterwards.
Trait Implementations§
§impl Clone for ProxyRuntimeColumn
impl Clone for ProxyRuntimeColumn
§fn clone(&self) -> ProxyRuntimeColumn
fn clone(&self) -> ProxyRuntimeColumn
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Forget for ProxyRuntimeColumn
impl Freeze for ProxyRuntimeColumn
impl Move for ProxyRuntimeColumn
impl RefUnwindSafe for ProxyRuntimeColumn
impl Send for ProxyRuntimeColumn
impl Sync for ProxyRuntimeColumn
impl Unpin for ProxyRuntimeColumn
impl UnsafeUnpin for ProxyRuntimeColumn
impl UnwindSafe for ProxyRuntimeColumn
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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> ⓘ
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 more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§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>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more