mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-03 17:52:12 +01:00
Fix the documentation
This commit is contained in:
parent
14561e437f
commit
47a70b8587
1 changed files with 19 additions and 17 deletions
|
@ -2,35 +2,37 @@
|
|||
//!
|
||||
//! There are four main components:
|
||||
//!
|
||||
//! 1. Your session type `Session`, which designates a dialogue state at the
|
||||
//! current moment.
|
||||
//! 2. [`Storage`], which encapsulates all the sessions.
|
||||
//! 3. Your handler, which receives an update and turns your session into the
|
||||
//! 1. Your type `State`, which designates a dialogue state at the current
|
||||
//! moment.
|
||||
//! 2. Your type `T`, which represents dialogue data.
|
||||
//! 3. [`Dialogue`], which encapsulates the two types, described above.
|
||||
//! 4. [`Storage`], which encapsulates all the sessions.
|
||||
//! 5. Your handler, which receives an update and turns your session into the
|
||||
//! next state.
|
||||
//! 4. [`SessionDispatcher`], which encapsulates your handler, [`Storage`], and
|
||||
//! 6. [`DialogueDispatcher`], which encapsulates your handler, [`Storage`], and
|
||||
//! implements [`CtxHandler`].
|
||||
//!
|
||||
//! You supply [`SessionDispatcher`] into [`Dispatcher`]. Every time
|
||||
//! [`Dispatcher`] calls `SessionDispatcher::handle_ctx(...)`, the following
|
||||
//! You supply [`DialogueDispatcher`] into [`Dispatcher`]. Every time
|
||||
//! [`Dispatcher`] calls `DialogueDispatcher::handle_ctx(...)`, the following
|
||||
//! steps are executed:
|
||||
//!
|
||||
//! 1. If a storage doesn't contain a session from this chat, supply
|
||||
//! `Session::default()` into you handler, otherwise, supply the saved session
|
||||
//! 1. If a storage doesn't contain a dialogue from this chat, supply
|
||||
//! `Dialogue::default()` into you handler, otherwise, supply the saved session
|
||||
//! from this chat.
|
||||
//! 3. If a handler has returned [`SessionState::Exit`], remove the session
|
||||
//! from the storage, otherwise ([`SessionState::Next`]) force the storage to
|
||||
//! 3. If a handler has returned [`DialogueStage::Exit`], remove the session
|
||||
//! from the storage, otherwise ([`DialogueStage::Next`]) force the storage to
|
||||
//! update the session.
|
||||
//!
|
||||
//! Please, see https://github.com/teloxide/teloxide/tree/dev/examples/simple_dialogue.
|
||||
//!
|
||||
//! [`Storage`]: crate::dispatching::session::Storage
|
||||
//! [`SessionDispatcher`]: crate::dispatching::session::SessionDispatcher
|
||||
//! [`SessionState::Exit`]:
|
||||
//! crate::dispatching::session::SessionState::Exit
|
||||
//! [`SessionState::Next`]: crate::dispatching::session::SessionState::Next
|
||||
//! [`DialogueDispatcher`]: crate::dispatching::session::SessionDispatcher
|
||||
//! [`DialogueStage::Exit`]:
|
||||
//! crate::dispatching::dialogue::DialogueStage::Exit
|
||||
//! [`DialogueStage::Next`]: crate::dispatching::dialogue::DialogueStage::Next
|
||||
//! [`CtxHandler`]: crate::dispatching::CtxHandler
|
||||
//! [`Dispatcher`]: crate::dispatching::Dispatcher
|
||||
|
||||
// TODO: examples
|
||||
|
||||
#![allow(clippy::module_inception)]
|
||||
#![allow(clippy::type_complexity)]
|
||||
|
||||
|
|
Loading…
Reference in a new issue