Struct trust_dns_proto::quic::QuicStream
source · [−]pub struct QuicStream { /* private fields */ }
Available on crate features
dns-over-quic
and tokio-runtime
only.Expand description
A single bi-directional stream
Implementations
sourceimpl 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<Message, ProtoError>
pub async fn receive(&mut self) -> Result<Message, 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 !RefUnwindSafe for QuicStream
impl Send for QuicStream
impl Sync for QuicStream
impl Unpin for QuicStream
impl !UnwindSafe for QuicStream
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more