[−][src]Struct pea2pea::connections::ConnectionReader
An object dedicated to performing reads from a connection's stream;
it is available only if the Reading
protocol is enabled.
Fields
span: Span
The tracing span of the owning Node
.
addr: SocketAddr
The address of the connection.
buffer: Box<[u8]>
A buffer dedicated to reading from the stream.
carry: usize
The number of bytes from an incomplete read carried over in the buffer.
reader: OwnedReadHalf
The read half of the stream.
Implementations
impl ConnectionReader
[src]
pub async fn read_queued_bytes(&mut self) -> Result<&[u8]>
[src]
Reads as many bytes as there are queued to be read from the stream.
pub async fn read_exact(&mut self, num: usize) -> Result<&[u8]>
[src]
Reads the specified number of bytes from the stream.
Auto Trait Implementations
impl !RefUnwindSafe for ConnectionReader
[src]
impl Send for ConnectionReader
[src]
impl Sync for ConnectionReader
[src]
impl Unpin for ConnectionReader
[src]
impl !UnwindSafe for ConnectionReader
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,