Struct urbit_http_api::apps::dm::DM [−][src]
pub struct DM<'a> {
pub channel: &'a mut Channel,
}Expand description
A struct that provides an interface for interacting with Urbit DMs
Fields
channel: &'a mut ChannelImplementations
Converts a ship @p to the dm_name string format used for DM channels
Send a message to an Urbit DM chat. Returns the index of the node that was added to Graph Store.
Extracts DM chat log automatically into a list of formatted Strings
Extracts a DM chat’s messages as AuthoredMessages
pub fn subscribe_to_dm(
&mut self,
dm_ship: &str,
dm_name: &str
) -> Result<Receiver<AuthoredMessage>>
pub fn subscribe_to_dm(
&mut self,
dm_ship: &str,
dm_name: &str
) -> Result<Receiver<AuthoredMessage>>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
Send a message to an Urbit chat/DM. Returns the index of the node that was added to Graph Store. Read more
Extracts messages automatically into a list of formatted Strings
Extracts messages as AuthoredMessages
Extracts a message nodes
fn subscribe_to_messages(
&mut self,
resource_ship: &str,
resource_name: &str
) -> Result<Receiver<AuthoredMessage>>
fn subscribe_to_messages(
&mut self,
resource_ship: &str,
resource_name: &str
) -> Result<Receiver<AuthoredMessage>>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. Read more
Auto Trait Implementations
impl<'a> !RefUnwindSafe for DM<'a>impl<'a> !UnwindSafe for DM<'a>Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
pub fn vzip(self) -> V