Skip to content

Commit

Permalink
Add docs for serializers module
Browse files Browse the repository at this point in the history
  • Loading branch information
Desiders committed Sep 16, 2023
1 parent 7970147 commit fe1ff69
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//!
//! [`Bot`] supports different [`Session`] implementations, which are used to send requests,
//! and [`Session`]s can be customized to fit your needs. Check [`Reqwest`] for more information about default implementation.
//! You can check example of create [`Bot`] with "other" client and using it in handlers in `examples/other_client.rs`.
//! You can check example of create [`Bot`] with "other" client and using it in handlers in `examples/bot_http_client`.
//!
//! You can use `Bot::send` method, which accepts any type that implements [`TelegramMethod`].
//! This method is the most comfortable, because you can use any method from [`methods module`] with
Expand Down
2 changes: 1 addition & 1 deletion src/client/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//! It accepts [`Bot`] instance, which is used for building request (for example, to get token),
//! and [`TelegramMethod`] instance, which is used for building request and [`ClientResponse`] instance,
//! because [`TelegramMethod`] contains information about response type and request data.
//! Check [`methods module`] for more information about methods.
//! Check [`methods module`] documentation for more information about methods.
//!
//! [`Bot`]: crate::client::Bot
//! [`TelegramMethod`]: crate::methods::TelegramMethod
Expand Down
2 changes: 1 addition & 1 deletion src/client/telegram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//! for testing your bot.
//!
//! You can create [`APIServer`] directly for using local Telegram Bot API server,
//! see example of using local Telegram Bot API server in `examples/local_server.rs`.
//! see example of using local Telegram Bot API server in `examples/local_server`.
//!
//! [`Session`]: crate::client::Session
Expand Down
8 changes: 8 additions & 0 deletions src/serializers.rs
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
//! This module contains the default serializers implementations for serializing the request body.
//!
//! `reqwest` serializer is enabled by default, if you want to use your own serializer, you can
//! do it for custom client and implement [`Session`] trait for it.
//! You can check example of using custom client in bot in `examples/bot_http_client`.
//!
//! [`Session`]: crate::client::Session
pub(crate) mod reqwest;
6 changes: 6 additions & 0 deletions src/serializers/reqwest.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
//! Default serializer for `reqwest` crate.
//!
//! Check [`serializers module`] documentation for more information about serializers.
//!
//! [`serializers module`]: crate::serializers
use reqwest::multipart::{Form, Part};
use serde::{
ser::{Error as SerError, Impossible, SerializeSeq, SerializeStruct},
Expand Down

0 comments on commit fe1ff69

Please sign in to comment.