pub struct SendStream { /* private fields */ }Expand description
The sending half of a stream.
Trait Implementations§
Source§impl Debug for SendStream
impl Debug for SendStream
Source§impl Drop for SendStream
impl Drop for SendStream
Source§impl SendStream for SendStream
impl SendStream for SendStream
Source§type Offset = ()
type Offset = ()
iroh does not report which bytes the peer acknowledged, so
poll_acked keeps its default, which
is ready as soon as the stream took the bytes.
Source§fn reset_at(&mut self, _offset: &(), code: u32)
fn reset_at(&mut self, _offset: &(), code: u32)
Resets the stream without delivering anything first.
The offset is (), so there is nothing to deliver up to. moq-net asks
for this only on sessions whose
reliable_reset is true, which iroh’s
is not, so a plain reset is what the caller expects.
Source§type Error = TransportError
type Error = TransportError
The error type for every operation on this stream.
Source§fn poll_write(
&mut self,
waiter: &Waiter,
buf: &[u8],
) -> Poll<Result<usize, TransportError>>
fn poll_write( &mut self, waiter: &Waiter, buf: &[u8], ) -> Poll<Result<usize, TransportError>>
Poll to write some of the buffer to the stream, returning how many bytes were
written. See
poll_write_buf for the partial-write
contract, which this shares.Source§fn set_priority(&mut self, priority: i64)
fn set_priority(&mut self, priority: i64)
Set the priority within the stream’s send group, or session-wide when ungrouped. Read more
Source§fn set_group(&mut self, group: &SendGroup)
fn set_group(&mut self, group: &SendGroup)
Move the stream into
group, which belongs to this stream’s session.Source§fn finish(&mut self) -> Result<(), TransportError>
fn finish(&mut self) -> Result<(), TransportError>
Mark the stream as finished, erroring on any future writes. Read more
Source§fn reset(&mut self, code: u32)
fn reset(&mut self, code: u32)
Immediately closes the stream and discards any remaining data. Read more
Source§fn poll_closed(&self, waiter: &Waiter) -> Poll<Result<(), TransportError>>
fn poll_closed(&self, waiter: &Waiter) -> Poll<Result<(), TransportError>>
Poll until the stream is closed by either side. Read more
Source§fn poll_acked(
&self,
waiter: &Waiter,
offset: &Self::Offset,
) -> Poll<Result<(), Self::Error>>
fn poll_acked( &self, waiter: &Waiter, offset: &Self::Offset, ) -> Poll<Result<(), Self::Error>>
Poll until every byte below
offset reaches the peer unless the session fails. Read moreSource§fn poll_write_buf<B>(
&mut self,
waiter: &Waiter,
buf: &mut B,
) -> Poll<Result<usize, Self::Error>>where
B: Buf,
fn poll_write_buf<B>(
&mut self,
waiter: &Waiter,
buf: &mut B,
) -> Poll<Result<usize, Self::Error>>where
B: Buf,
Poll to write some of the given buffer to the stream, advancing it by the
number of bytes written. This may be less than the whole buffer, so callers
loop. Read more
Source§fn write<'a>(&'a mut self, buf: &'a [u8]) -> Write<'a, Self> ⓘ
fn write<'a>(&'a mut self, buf: &'a [u8]) -> Write<'a, Self> ⓘ
Write some of the buffer, returning how many bytes were accepted.
Source§fn write_buf<'a, B>(&'a mut self, buf: &'a mut B) -> WriteBuf<'a, Self, B> ⓘwhere
B: Buf,
fn write_buf<'a, B>(&'a mut self, buf: &'a mut B) -> WriteBuf<'a, Self, B> ⓘwhere
B: Buf,
Write some of the buffer, advancing it by the bytes accepted.
Source§fn write_chunk(&mut self, chunk: Bytes) -> WriteChunk<'_, Self> ⓘ
fn write_chunk(&mut self, chunk: Bytes) -> WriteChunk<'_, Self> ⓘ
Write the entire chunk to the stream.
Source§fn closed(&self) -> SendClosed<'_, Self> ⓘ
fn closed(&self) -> SendClosed<'_, Self> ⓘ
Wait until the stream is closed by either side.
Auto Trait Implementations§
impl !Freeze for SendStream
impl RefUnwindSafe for SendStream
impl Send for SendStream
impl Sync for SendStream
impl Unpin for SendStream
impl UnsafeUnpin for SendStream
impl UnwindSafe for SendStream
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more