Trait urbit_http_api::traits::messaging::Messaging[][src]

pub trait Messaging {
    fn channel(&mut self) -> &mut Channel;

    fn send_message(
        &mut self,
        resource_ship: &str,
        resource_name: &str,
        message: &Message
    ) -> Result<String> { ... }
fn export_message_log(
        &mut self,
        resource_ship: &str,
        resource_name: &str
    ) -> Result<Vec<String>> { ... }
fn export_authored_messages(
        &mut self,
        resource_ship: &str,
        resource_name: &str
    ) -> Result<Vec<AuthoredMessage>> { ... }
fn export_message_nodes(
        &mut self,
        resource_ship: &str,
        resource_name: &str
    ) -> Result<Vec<Node>> { ... }
fn subscribe_to_messages(
        &mut self,
        resource_ship: &str,
        resource_name: &str
    ) -> Result<Receiver<AuthoredMessage>> { ... } }

A trait which wraps both chats & DMs.

Required methods

fn channel(&mut self) -> &mut Channel[src]

Returns the reference to the Channel being used

Loading content...

Provided methods

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

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

fn export_message_log(
    &mut self,
    resource_ship: &str,
    resource_name: &str
) -> Result<Vec<String>>
[src]

Extracts messages automatically into a list of formatted Strings

fn export_authored_messages(
    &mut self,
    resource_ship: &str,
    resource_name: &str
) -> Result<Vec<AuthoredMessage>>
[src]

Extracts messages as AuthoredMessages

fn export_message_nodes(
    &mut self,
    resource_ship: &str,
    resource_name: &str
) -> Result<Vec<Node>>
[src]

Extracts a message nodes

fn subscribe_to_messages(
    &mut self,
    resource_ship: &str,
    resource_name: &str
) -> Result<Receiver<AuthoredMessage>>
[src]

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

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.

Loading content...

Implementors

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

impl<'a> Messaging for DM<'a>[src]

Loading content...