[][src]Struct hypercore_protocol::Channel

pub struct Channel { /* fields omitted */ }

A protocol channel.

This is the outer channel handler that can be sent to other threads.

Implementations

impl Channel[src]

pub fn discovery_key(&self) -> &[u8][src]

Get the discovery key of this channel.

pub async fn send<'_>(&'_ mut self, message: Message) -> Result<()>[src]

Send a message over the channel.

pub fn take_receiver(&mut self) -> Option<Receiver<Message>>[src]

pub async fn status<'_>(&'_ mut self, msg: Status) -> Result<()>[src]

Send a status message.

pub async fn options<'_>(&'_ mut self, msg: Options) -> Result<()>[src]

Send a options message.

pub async fn have<'_>(&'_ mut self, msg: Have) -> Result<()>[src]

Send a have message.

pub async fn unhave<'_>(&'_ mut self, msg: Unhave) -> Result<()>[src]

Send a unhave message.

pub async fn want<'_>(&'_ mut self, msg: Want) -> Result<()>[src]

Send a want message.

pub async fn unwant<'_>(&'_ mut self, msg: Unwant) -> Result<()>[src]

Send a unwant message.

pub async fn request<'_>(&'_ mut self, msg: Request) -> Result<()>[src]

Send a request message.

pub async fn cancel<'_>(&'_ mut self, msg: Cancel) -> Result<()>[src]

Send a cancel message.

pub async fn data<'_>(&'_ mut self, msg: Data) -> Result<()>[src]

Send a data message.

pub async fn close<'_>(&'_ mut self, msg: Close) -> Result<()>[src]

Send a close message and close this channel.

Trait Implementations

impl Debug for Channel[src]

impl Stream for Channel[src]

type Item = Message

Values yielded by the stream.

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, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> StreamExt for T where
    T: Stream + ?Sized
[src]

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