Trait ReplaceContext

Source
pub trait ReplaceContext<C: Context>: View {
    type Target: View<Context = C>;

    // Required method
    async fn with_context(
        &mut self,
        ctx: impl FnOnce(&Self::Context) -> C + Clone,
    ) -> Self::Target;
}
Expand description

A view which can have its context replaced.

Required Associated Types§

Source

type Target: View<Context = C>

The type returned after replacing the context.

Required Methods§

Source

async fn with_context( &mut self, ctx: impl FnOnce(&Self::Context) -> C + Clone, ) -> Self::Target

Returns a view with a replaced context.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<C, C2, I, V> ReplaceContext<C2> for MapView<C, I, V>
where C: Context, C2: Context, I: Send + Sync, V: Send + Sync + Serialize + Clone,

Source§

type Target = MapView<C2, I, V>

Source§

impl<C, T, C2> ReplaceContext<C2> for RegisterView<C, T>

Source§

impl<C, W, O, C2> ReplaceContext<C2> for WrappedHashableContainerView<C, W, O>
where W: HashableView<Hasher: Hasher<Output = O>, Context = C> + ReplaceContext<C2>, <W as ReplaceContext<C2>>::Target: HashableView<Hasher: Hasher<Output = O>>, O: Serialize + DeserializeOwned + Send + Sync + Copy + PartialEq, C: Context, C2: Context,

Source§

impl<C: Context, C2: Context> ReplaceContext<C2> for KeyValueStoreView<C>

Source§

impl<C: Context, C2: Context> ReplaceContext<C2> for ByteSetView<C>

Source§

impl<C: Context, C2: Context, V> ReplaceContext<C2> for ByteMapView<C, V>
where V: Send + Sync + Serialize + Clone,

Source§

impl<C: Context, I: Send + Sync + Serialize, C2: Context> ReplaceContext<C2> for SetView<C, I>

Source§

type Target = SetView<C2, I>

Source§

impl<I, W, C2> ReplaceContext<C2> for ReentrantCollectionView<W::Context, I, W>

Source§

impl<W, C2> ReplaceContext<C2> for ReentrantByteCollectionView<W::Context, W>
where W: View + ReplaceContext<C2>, C2: Context,