[−][src]Struct rocketchat_client_rs::RocketClient
RocketClient represents a minimal rocketchat client which can be used to send text messages to a given webhook.
Examples
Basic usage:
ⓘThis example is not tested
use crate::client::RocketClient; let client = RocketClient::new("www.facebook.com") .with_channel("#test-logs") .execute();
Methods
impl RocketClient
[src]
pub fn new<T>(webhook: T) -> Self where
T: Into<String>,
[src]
T: Into<String>,
pub fn with_channel<T>(&mut self, channel: T) -> &mut Self where
T: Into<String>,
[src]
T: Into<String>,
Define the channel name where this message is to be sent
Examples
Basic usage:
ⓘThis example is not tested
use crate::client::RocketClient; let client = RocketClient::new("www.facebook.com") .with_channel("#test-logs") .execute();
pub fn with_hostname<T>(&mut self, hostname: T) -> &mut Self where
T: Into<String>,
[src]
T: Into<String>,
Define the hostname from which this message is being sent
Examples
Basic usage:
ⓘThis example is not tested
use crate::client::RocketClient; let client = RocketClient::new("www.facebook.com") .with_hostname("my-machine") .execute();
pub fn with_text<T>(&mut self, text: T) -> &mut Self where
T: Into<String>,
[src]
T: Into<String>,
Define text which is to be sent.
Examples
Basic usage:
ⓘThis example is not tested
use crate::client::RocketClient; let client = RocketClient::new("www.facebook.com") .with_channel("#test-logs") .with_text("Hi world") .execute();
pub fn with_default_hostname(&mut self) -> &mut Self
[src]
Add default hostname with the message being sent
Examples
Basic usage:
ⓘThis example is not tested
use crate::client::RocketClient; let client = RocketClient::new("www.facebook.com") .with_channel("#test-logs") .with_default_hostname() .execute();
pub fn with_botname<T>(&mut self, botname: T) -> &mut Self where
T: Into<Option<String>>,
[src]
T: Into<Option<String>>,
Add botname with the message being sent
Examples
Basic usage:
ⓘThis example is not tested
use crate::client::RocketClient; let client = RocketClient::new("www.facebook.com") .with_channel("#test-logs") .with_botname("some-bot") .execute();
pub fn with_emoji<T>(&mut self, emoji: T) -> &mut Self where
T: Into<Option<String>>,
[src]
T: Into<Option<String>>,
Add emoji with the message being sent
Examples
Basic usage:
ⓘThis example is not tested
use crate::client::RocketClient; let client = RocketClient::new("www.facebook.com") .with_channel("#test-logs") .with_emoji(":sos:") .execute();
pub fn execute(&mut self) -> Result<(), Error>
[src]
Execute the builder pattern finally after constructing the object.
Examples
Basic usage:
ⓘThis example is not tested
use crate::client::RocketClient; let client = RocketClient::new("www.facebook.com") .with_channel("#test-logs") .with_text("Hi world") .with_default_hostname() .execute();
Trait Implementations
impl Default for RocketClient
[src]
fn default() -> RocketClient
[src]
impl Debug for RocketClient
[src]
impl Serialize for RocketClient
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for RocketClient
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Send for RocketClient
impl Sync for RocketClient
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> Erased for T
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,