Struct urbit_http_api::channel::Channel[][src]

pub struct Channel {
    pub ship_interface: ShipInterface,
    pub uid: String,
    pub url: String,
    pub subscription_list: Vec<Subscription>,
    pub message_id_count: u64,
    // some fields omitted
}

A Channel which is used to interact with a ship

Fields

ship_interface: ShipInterface

ShipInterface this channel is created from

uid: String

The uid of the channel

url: String

The url of the channel

subscription_list: Vec<Subscription>message_id_count: u64

The current number of messages that have been sent out (which are also defined as message ids) via this Channel

Implementations

impl Channel[src]

Channel methods for basic functionality

pub fn new(ship_interface: ShipInterface) -> Result<Channel>[src]

Create a new channel

pub fn poke(
    &mut self,
    app: &str,
    mark: &str,
    json: &JsonValue
) -> Result<Response>
[src]

Sends a poke over the channel

pub fn scry(&self, app: &str, path: &str, mark: &str) -> Result<Response>[src]

Sends a scry to the ship

pub fn spider(
    &self,
    input_mark: &str,
    output_mark: &str,
    thread_name: &str,
    body: &JsonValue
) -> Result<Response>
[src]

Run a thread via spider

pub fn create_new_subscription(
    &mut self,
    app: &str,
    path: &str
) -> Result<CreationID>
[src]

Create a new Subscription and thus subscribes to events on the ship with the provided app/path.

pub fn parse_event_messages(&mut self)[src]

Parses SSE messages for this channel and moves them into the proper corresponding Subscription’s message_list.

pub fn find_subscription(
    &mut self,
    app: &str,
    path: &str
) -> Option<&mut Subscription>
[src]

Finds the first Subscription in the list which has a matching app and path;

pub fn unsubscribe(&mut self, app: &str, path: &str) -> Option<bool>[src]

Finds the first Subscription in the list which has a matching app and path, removes it from the list, and tells the ship that you are unsubscribing. Returns None if failed to find a subscription with a matching app & path.

pub fn delete_channel(self)[src]

Deletes the channel

impl Channel[src]

Channel methods which expose advanced functionality, typically by producing another struct which is built on top of Channel.

pub fn chat(&mut self) -> Chat<'_>[src]

Create a Chat struct which exposes an interface for interacting with chats on Urbit

pub fn notebook(&mut self) -> Notebook<'_>[src]

Create a Notebook struct which exposes an interface for interacting with notebooks on Urbit

pub fn graph_store(&mut self) -> GraphStore<'_>[src]

Create a GraphStore struct which exposes an interface for interacting with a ship’s Graph Store.

pub fn collection(&mut self) -> Collection<'_>[src]

Create a Collection struct which exposes an interface for interacting with collections on Urbit.

Trait Implementations

impl Debug for Channel[src]

Auto Trait Implementations

impl !RefUnwindSafe for Channel

impl Send for Channel

impl Sync for Channel

impl Unpin for Channel

impl !UnwindSafe for Channel

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>,