pub struct Stream(_);
Expand description
Wrapper type around TCP stream for implementing FTCP-specific traits
Trait Implementations
sourceimpl RecvFrame for Stream
impl RecvFrame for Stream
sourcefn recv_frame(&mut self) -> Result<Vec<u8>, Error>
fn recv_frame(&mut self) -> Result<Vec<u8>, Error>
Receive a single frame of data structured as a byte string. The frame contains LNP framing prefix, which is used by upstream session-level protocols. Read more
sourcefn recv_raw(&mut self, len: usize) -> Result<Vec<u8>, Error>
fn recv_raw(&mut self, len: usize) -> Result<Vec<u8>, Error>
Try to receive len
number of bytes and pack them as a frame.
The actual amount of bytes received may differ for some protocols,
like ZMQ, so the function should be used with caution! Read more
sourcefn recv_routed(&mut self) -> Result<RoutedFrame, Error>
fn recv_routed(&mut self) -> Result<RoutedFrame, Error>
Receive frame like with RecvFrame::recv_frame
, but only originating
from the specified remote address. Read more
sourceimpl SendFrame for Stream
impl SendFrame for Stream
sourcefn send_frame(&mut self, data: &[u8]) -> Result<usize, Error>
fn send_frame(&mut self, data: &[u8]) -> Result<usize, Error>
Sends a single frame of data structured as a byte string. The frame must
already contain LNP framing prefix with size data. The function must
check that the provided data frame length is below the limit defined
with MAX_FRAME_SIZE
constant. Read more
sourcefn send_raw(&mut self, data: &[u8]) -> Result<usize, Error>
fn send_raw(&mut self, data: &[u8]) -> Result<usize, Error>
Sends a single frame of data structured as a byte string. The frame must already contain LNP framing prefix with size data. Read more
sourcefn send_routed(
&mut self,
_source: &[u8],
_route: &[u8],
_address: &[u8],
_data: &[u8]
) -> Result<usize, Error>
fn send_routed(
&mut self,
_source: &[u8],
_route: &[u8],
_address: &[u8],
_data: &[u8]
) -> Result<usize, Error>
Sends a single frame of data structured as a byte string to a specific
receiver with remote_id
. Function works like RecvFrame::recv_frame
and is used for the underlying protocols supporting multipeer
connectivity. The frame must already contain LNP framing prefix with
size data. The function must check that the provided data frame
length is below the limit defined with MAX_FRAME_SIZE
constant. Read more
impl Stream for Stream
Auto Trait Implementations
impl RefUnwindSafe for Stream
impl Send for Stream
impl Sync for Stream
impl Unpin for Stream
impl UnwindSafe for Stream
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more