pub struct ActixAdapter<A, M, B>where
A: Actor + Handler<M>,
M: Message + Cacheable + Send,
M::Result: MessageResponse<A, M> + Send,
B: Backend,{ /* private fields */ }Expand description
RuntimeAdapter for Actix runtime.
Implementations§
Source§impl<A, M, B> ActixAdapter<A, M, B>
impl<A, M, B> ActixAdapter<A, M, B>
Sourcepub fn new(
message: QueryCache<A, M>,
backend: Addr<B>,
) -> Result<Self, CacheError>
pub fn new( message: QueryCache<A, M>, backend: Addr<B>, ) -> Result<Self, CacheError>
Creates new instance of Actix runtime adapter.
Trait Implementations§
Source§impl<A, M, T, B, U> RuntimeAdapter for ActixAdapter<A, M, B>where
A: Actor + Handler<M>,
A::Context: ToEnvelope<A, M>,
M: Message<Result = T> + Cacheable + Send + 'static,
M::Result: MessageResponse<A, M> + Send,
B: Backend,
<B as Actor>::Context: ToEnvelope<B, Get> + ToEnvelope<B, Set>,
T: CacheableResponse<Cached = U> + 'static,
U: DeserializeOwned + Serialize,
impl<A, M, T, B, U> RuntimeAdapter for ActixAdapter<A, M, B>where
A: Actor + Handler<M>,
A::Context: ToEnvelope<A, M>,
M: Message<Result = T> + Cacheable + Send + 'static,
M::Result: MessageResponse<A, M> + Send,
B: Backend,
<B as Actor>::Context: ToEnvelope<B, Get> + ToEnvelope<B, Set>,
T: CacheableResponse<Cached = U> + 'static,
U: DeserializeOwned + Serialize,
Source§type UpstreamResult = T
type UpstreamResult = T
Associated type describes the upstream result.
Source§fn poll_upstream(&mut self) -> AdapterResult<Self::UpstreamResult>
fn poll_upstream(&mut self) -> AdapterResult<Self::UpstreamResult>
Send data to upstream and return
Self::UpstreamResultSource§fn poll_cache(&self) -> AdapterResult<CacheState<Self::UpstreamResult>>
fn poll_cache(&self) -> AdapterResult<CacheState<Self::UpstreamResult>>
Check cache and return current state of cached data.
Source§fn update_cache(
&self,
cached_value: &CachedValue<Self::UpstreamResult>,
) -> AdapterResult<()>
fn update_cache( &self, cached_value: &CachedValue<Self::UpstreamResult>, ) -> AdapterResult<()>
Write or update
Self::UpstreamResult into cache.Source§fn eviction_settings(&self) -> EvictionPolicy
fn eviction_settings(&self) -> EvictionPolicy
Returns eviction settings for current cacheable data.
Auto Trait Implementations§
impl<A, M, B> !RefUnwindSafe for ActixAdapter<A, M, B>
impl<A, M, B> !UnwindSafe for ActixAdapter<A, M, B>
impl<A, M, B> Freeze for ActixAdapter<A, M, B>where
M: Freeze,
impl<A, M, B> Send for ActixAdapter<A, M, B>
impl<A, M, B> Sync for ActixAdapter<A, M, B>where
M: Sync,
impl<A, M, B> Unpin for ActixAdapter<A, M, B>where
M: Unpin,
impl<A, M, B> UnsafeUnpin for ActixAdapter<A, M, B>where
M: UnsafeUnpin,
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