Struct botx_api::api::context::BotXApiContextConfiguration
source · pub struct BotXApiContextConfiguration {
pub cts_url: String,
pub bot_id: String,
pub secret_key: String,
}Expand description
При интеграции с anthill-di позволяет переопределить настройки бота (по умолчанию берется информация из переменных среды)
Чтобы переопределить, зарегистрируйте фабрику на основе замыкания с настройкой необходимой конфигурации
ioc.register_closure(|| Ok(BotXApiContextConfiguration { cts_url: "http:xxxx.ru", ... }), LifeTime::Transient).await.unwrap();
Fields§
§cts_url: String§bot_id: String§secret_key: StringImplementations§
source§impl BotXApiContextConfiguration
impl BotXApiContextConfiguration
pub const DEFAULT_CTS_URL_ENV: &str = "BOTX_API_CTS_URL"
pub const DEFAULT_BOT_ID_ENV: &str = "BOTX_API_BOT_ID"
pub const DEFAULT_BOT_SECRET_KEY_ENV: &str = "BOTX_API_BOT_SECRET_KEY"
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for BotXApiContextConfiguration
impl Send for BotXApiContextConfiguration
impl Sync for BotXApiContextConfiguration
impl Unpin for BotXApiContextConfiguration
impl UnwindSafe for BotXApiContextConfiguration
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more