JavaScript is disabled, refresh for a better experience. ambee/giterated

ambee/giterated

Git repository hosting, collaboration, and discovery for the Fediverse.

Finish unified stack refactor.

Adds support for operation state, which will be used to pass authentication information around. Added generic backend that uses a channel to communicate with a typed backend.

Amber - ⁨2⁩ years ago

parent: tbd commit: ⁨d15581c

⁨giterated-stack/src/state.rs⁩ - ⁨532⁩ bytes
Raw
1 use std::any::Any;
2
3 /// A type which can be passed into a stateful handler.
4 ///
5 /// # Trait Bounds
6 /// This trait is bound on `Send + Sync`, as well as `Clone`. Handler states are
7 /// cloned many times, and should be inexpensive to clone.
8 ///
9 /// # Blanket Impl
10 /// This trait is blanket-impl'd on any type that meets the requirements. You do not need
11 /// to manually mark your state types with it.
12 pub trait HandlerState: Any + Send + Sync + Clone + 'static {}
13
14 impl<T> HandlerState for T where T: Send + Sync + Clone + 'static {}
15