pub struct QuicStream { /* private fields */ }
Available on crate features
dns-over-quic
and tokio-runtime
only.Expand description
A single bi-directional stream
Implementations§
Source§impl QuicStream
impl QuicStream
Sourcepub async fn send(&mut self, message: Message) -> Result<(), ProtoError>
pub async fn send(&mut self, message: Message) -> Result<(), ProtoError>
Send the DNS message to the other side
Sourcepub async fn send_bytes(&mut self, bytes: Bytes) -> Result<(), ProtoError>
pub async fn send_bytes(&mut self, bytes: Bytes) -> Result<(), ProtoError>
Send pre-encoded bytes, warning, QUIC requires the message id to be 0.
Sourcepub async fn finish(&mut self) -> Result<(), ProtoError>
pub async fn finish(&mut self) -> Result<(), ProtoError>
finishes the send stream, i.e. there will be no more data sent to the remote
Sourcepub async fn receive(&mut self) -> Result<DnsResponse, ProtoError>
pub async fn receive(&mut self) -> Result<DnsResponse, ProtoError>
Receive a single packet
Sourcepub async fn receive_bytes(&mut self) -> Result<BytesMut, ProtoError>
pub async fn receive_bytes(&mut self) -> Result<BytesMut, ProtoError>
Receive a single packet as raw bytes
Sourcepub fn reset(&mut self, code: DoqErrorCode) -> Result<(), ProtoError>
pub fn reset(&mut self, code: DoqErrorCode) -> Result<(), ProtoError>
Reset the sending stream due to some error
Sourcepub fn stop(&mut self, code: DoqErrorCode) -> Result<(), ProtoError>
pub fn stop(&mut self, code: DoqErrorCode) -> Result<(), ProtoError>
Stop the receiving stream due to some error
Auto Trait Implementations§
impl Freeze for QuicStream
impl RefUnwindSafe for QuicStream
impl Send for QuicStream
impl Sync for QuicStream
impl Unpin for QuicStream
impl UnwindSafe for QuicStream
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