pub trait GotchaApp:
Sized
+ Send
+ Sync {
type State: Clone + Send + Sync + 'static;
type Config: Clone + Send + Sync + 'static + Serialize + for<'de> Deserialize<'de>;
// Required methods
fn routes(
&self,
router: GotchaRouter<GotchaContext<Self::State, Self::Config>>,
) -> GotchaRouter<GotchaContext<Self::State, Self::Config>>;
fn state<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 ConfigWrapper<Self::Config>,
) -> Pin<Box<dyn Future<Output = Result<Self::State, Box<dyn Error>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn logger(&self) -> Result<(), Box<dyn Error>> { ... }
fn tasks<'life0, 'life1, 'async_trait>(
&'life0 self,
_task_scheduler: &'life1 mut TaskScheduler<Self::State, Self::Config>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn run<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error>>> + Send + 'async_trait>>
where Self: 'async_trait { ... }
}Required Associated Types§
type State: Clone + Send + Sync + 'static
type Config: Clone + Send + Sync + 'static + Serialize + for<'de> Deserialize<'de>
Required Methods§
fn routes( &self, router: GotchaRouter<GotchaContext<Self::State, Self::Config>>, ) -> GotchaRouter<GotchaContext<Self::State, Self::Config>>
fn state<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 ConfigWrapper<Self::Config>,
) -> Pin<Box<dyn Future<Output = Result<Self::State, Box<dyn Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Provided Methods§
fn logger(&self) -> Result<(), Box<dyn Error>>
fn tasks<'life0, 'life1, 'async_trait>(
&'life0 self,
_task_scheduler: &'life1 mut TaskScheduler<Self::State, Self::Config>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn run<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
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.