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

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
}

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]

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

Create a new channel

pub fn get_and_raise_message_id_count(&mut self) -> u64[src]

Acquires and returns the current message_id_count from the ShipInterface that this channel was created from while also increase said value by 1.

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

Sends a poke over the channel

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

Trait Implementations

impl Debug for Channel[src]

Auto Trait Implementations

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