Struct urbit_http_api::apps::dm::DM[][src]

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

A struct that provides an interface for interacting with Urbit DMs

Fields

channel: &'a mut Channel

Implementations

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

pub fn ship_to_dm_name(&self, ship: &str) -> String[src]

Converts a ship @p to the dm_name string format used for DM channels

pub fn send_dm_message(
    &mut self,
    dm_ship: &str,
    dm_name: &str,
    message: &Message
) -> Result<String>
[src]

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

pub fn export_dm_log(
    &mut self,
    dm_ship: &str,
    dm_name: &str
) -> Result<Vec<String>>
[src]

Extracts DM chat log automatically into a list of formatted Strings

pub fn export_dm_authored_messages(
    &mut self,
    dm_ship: &str,
    dm_name: &str
) -> Result<Vec<AuthoredMessage>>
[src]

Extracts a DM chat’s messages as AuthoredMessages

pub fn subscribe_to_dm(
    &mut self,
    dm_ship: &str,
    dm_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.

Trait Implementations

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

Auto Trait Implementations

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

impl<'a> Send for DM<'a>

impl<'a> Sync for DM<'a>

impl<'a> Unpin for DM<'a>

impl<'a> !UnwindSafe for DM<'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>,