Struct urbit_http_api::chat::Chat[][src]

pub struct Chat<'a> {
    pub channel: &'a mut Channel,
}

A struct that provides an interface for interacting with Urbit chats

Fields

channel: &'a mut Channel

Implementations

impl<'a> Chat<'a>[src]

Methods for interacting with a Chat

pub fn send_message(
    &mut self,
    chat_ship: &str,
    chat_name: &str,
    message: &Message
) -> Result<String>
[src]

Send a message to an Urbit chat. Returns the index of the node that was added to Graph Store.

pub fn export_chat_log(
    &mut self,
    chat_ship: &str,
    chat_name: &str
) -> Result<Vec<String>>
[src]

Extracts a Chat’s messages automatically into a list of formatted Strings

pub fn export_authored_messages(
    &mut self,
    chat_ship: &str,
    chat_name: &str
) -> Result<Vec<AuthoredMessage>>
[src]

Extracts a Chat’s messages as AuthoredMessages

pub fn subscribe_to_chat(
    &mut self,
    chat_ship: &str,
    chat_name: &str
) -> Result<Receiver<AuthoredMessage>>
[src]

Subscribe to and watch for messages for a specific chat. This method returns a Receiver with the AuthoredMessages that are posted to the chat after subscribing. Simply call receiver.try_recv() to read the next AuthoredMessage if one has been posted in the specified chat.

Technical Note: This method actually creates a new Channel with your Urbit Ship, and spawns a new unix thread locally that processes all messages on said channel. This is required due to borrowing mechanisms in Rust, however on the plus side this makes it potentially more performant by each subscription having it’s own unix thread.

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Chat<'a>

impl<'a> Send for Chat<'a>

impl<'a> Sync for Chat<'a>

impl<'a> Unpin for Chat<'a>

impl<'a> !UnwindSafe for Chat<'a>

Blanket Implementations

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

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

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

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

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

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

impl<T> Pointable for T

type Init = T

The type for initializers.

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<V, T> VZip<V> for T where
    V: MultiLane<T>,