[][src]Struct carrier::channel::Channel

pub struct Channel {
    pub debug_id: String,
    // some fields omitted
}

Fields

debug_id: String

Methods

impl Channel[src]

pub fn new<S: Into<String>>(noise: Transport, debug_id: S) -> Self[src]

pub fn bytes_in_flight(&self) -> usize[src]

pub fn window(&self) -> usize[src]

pub fn is_initiator(&self) -> bool[src]

pub fn recv(&mut self, pkt: EncryptedPacket) -> Result<(), Error>[src]

receive a packet from the wire

pub fn handle_loss(&mut self, loss: LossDetection)[src]

pub fn progress(&mut self) -> Result<ChannelProgress, Error>[src]

progress the channel and return something that happened this needs to be polled until it returns Later or Disconnectd

pub fn stream<M: Into<Vec<u8>>>(&mut self, stream: u32, msg: M)[src]

queue a message

pub fn open<M: Into<Vec<u8>>>(
    &mut self,
    payload: M,
    are_we_initiator: bool
) -> u32
[src]

open a new stream, given a header

pub fn header<M: Into<Vec<u8>>>(&mut self, stream: u32, payload: M)[src]

send headers (as a response)

pub fn close(&mut self, stream: u32)[src]

queue a close, stream may still be able to receive (this is half close)

pub fn remove(&mut self, stream: u32)[src]

remove a stream (full close)

pub fn disconnect(&mut self) -> Result<Vec<u8>, Error>[src]

create a disconnect packet

pub fn probe(&mut self)[src]

send probe packets

pub fn config(&mut self, config: Config)[src]

configure network

Auto Trait Implementations

impl Send for Channel

impl Sync for Channel

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Same for T

type Output = T

Should always be Self