Struct telexide::client::WebhookOptions
source · pub struct WebhookOptions {
pub url: Option<Uri>,
pub path: String,
pub port: u16,
pub ip: IpAddr,
pub secret_token: Option<String>,
}
Expand description
Represents the options to set for the webhook handling
Fields§
§url: Option<Uri>
§path: String
§port: u16
§ip: IpAddr
§secret_token: Option<String>
Implementations§
source§impl WebhookOptions
impl WebhookOptions
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new WebhookOptions
with default values
By default it will listen on 127.0.0.1:8006 and the path being the root
sourcepub fn set_port(&mut self, port: u16) -> &mut Self
pub fn set_port(&mut self, port: u16) -> &mut Self
Sets the port the webhook will be listening on
sourcepub fn set_ip<T: Into<IpAddr>>(&mut self, ip: T) -> &mut Self
pub fn set_ip<T: Into<IpAddr>>(&mut self, ip: T) -> &mut Self
Sets the IP the webhook will be listening on
sourcepub fn set_url(&mut self, url: &str) -> TelegramResult<&mut Self>
pub fn set_url(&mut self, url: &str) -> TelegramResult<&mut Self>
Sets the url of the webhook
sourcepub fn set_secret_token(
&mut self,
secret_token: &impl ToString
) -> TelegramResult<&mut Self>
pub fn set_secret_token( &mut self, secret_token: &impl ToString ) -> TelegramResult<&mut Self>
Sets the secret token of the webhook
Trait Implementations§
source§impl Clone for WebhookOptions
impl Clone for WebhookOptions
source§fn clone(&self) -> WebhookOptions
fn clone(&self) -> WebhookOptions
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for WebhookOptions
impl Debug for WebhookOptions
Auto Trait Implementations§
impl RefUnwindSafe for WebhookOptions
impl Send for WebhookOptions
impl Sync for WebhookOptions
impl Unpin for WebhookOptions
impl UnwindSafe for WebhookOptions
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