Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions quinn/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,10 @@ impl Connection {
}

/// Receive an application datagram
///
/// Guarantees:
/// - Cancel-safe future
/// - First poll resolves immediately if a datagram is available
pub fn read_datagram(&self) -> ReadDatagram<'_> {
ReadDatagram {
conn: &self.0,
Expand Down Expand Up @@ -430,6 +434,10 @@ impl Connection {
///
/// Previously queued datagrams which are still unsent may be discarded to make space for this
/// datagram, in order of oldest to newest.
///
/// Guarantees:
/// - Cancel-safe future
/// - First poll resolves immediately if given datagram can be sent
pub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError> {
let conn = &mut *self.0.state.lock("send_datagram");
if let Some(ref x) = conn.error {
Expand Down
Loading