pub struct WebhookClient { /* private fields */ }Expand description
A Client that sends webhooks for discord.
Implementations§
Source§impl WebhookClient
impl WebhookClient
pub fn new(url: &str) -> Self
Sourcepub async fn send<Func>(&self, function: Func) -> WebhookResult<bool>
pub async fn send<Func>(&self, function: Func) -> WebhookResult<bool>
Example
let client = WebhookClient::new("URL");
client.send(|message| message
.content("content")
.username("username")).await?;pub async fn send_message(&self, message: &Message) -> WebhookResult<bool>
Auto Trait Implementations§
impl Freeze for WebhookClient
impl !RefUnwindSafe for WebhookClient
impl Send for WebhookClient
impl Sync for WebhookClient
impl Unpin for WebhookClient
impl !UnwindSafe for WebhookClient
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