[][src]Struct rocketchat_client_rs::RocketClient

pub struct RocketClient { /* fields omitted */ }

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 rocketchat_client_rs::RocketClient;
let _response = 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]

pub fn with_channel<T>(&mut self, channel: T) -> &mut Self where
    T: Into<String>, 
[src]

Define the channel name where this message is to be sent

Examples

Basic usage:

This example is not tested
use rocketchat_client_rs::RocketClient;
let _response = 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]

Define the hostname from which this message is being sent

Examples

Basic usage:

This example is not tested
use rocketchat_client_rs::RocketClient;
let _response = 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]

Define text which is to be sent.

Examples

Basic usage:

This example is not tested
use rocketchat_client_rs::RocketClient;
let _response = 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 rocketchat_client_rs::RocketClient;
let _response = 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]

Add botname with the message being sent

Examples

Basic usage:

This example is not tested
use rocketchat_client_rs::RocketClient;
let _response = 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]

Add emoji with the message being sent

Examples

Basic usage:

This example is not tested
use rocketchat_client_rs::RocketClient;
let _response = 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 rocketchat_client_rs::RocketClient;
let _response = RocketClient::new("www.facebook.com")
	.with_channel("#test-logs")
	.with_text("Hi world")
	.with_default_hostname()
    .execute();

Trait Implementations

impl Default for RocketClient[src]

impl Debug for RocketClient[src]

impl Serialize for RocketClient[src]

impl<'de> Deserialize<'de> for RocketClient[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Erased for T

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err