Skip to main content

WebTransportEvent

Enum WebTransportEvent 

Source
pub enum WebTransportEvent {
Show 14 variants BidiStreamOpen { stream_id: u64, session_id: u64, }, BidiStreamData { stream_id: u64, data: Vec<u8>, }, BidiStreamEnd { stream_id: u64, }, UniStreamOpen { stream_id: u64, session_id: u64, }, UniStreamData { stream_id: u64, data: Vec<u8>, }, UniStreamEnd { stream_id: u64, }, SessionClosed { session_id: u64, reset_streams: Vec<WtStreamReset>, error_code: u64, close_error_code: u32, close_message: String, }, SessionEstablished { session_id: u64, flow_control_enabled: bool, }, SessionDraining { session_id: u64, }, Capsule { session_id: u64, capsule: Capsule, }, Datagram { session_id: u64, payload: Vec<u8>, }, StreamReset { session_id: u64, stream_id: u64, error_code: u64, final_size: u64, }, StreamStopSending { session_id: u64, stream_id: u64, error_code: u64, }, BufferedStreamRejected { stream_id: u64, error_code: u64, },
}
Expand description

WebTransport イベント

WebTransport 関連のイベントを集約した enum。 Event::WebTransport(WebTransportEvent) として使用する。

Variants§

§

BidiStreamOpen

双方向ストリーム開始 (draft-ietf-webtrans-http3-15 Section 4.3)

Fields

§stream_id: u64

QUIC ストリーム ID

§session_id: u64

WebTransport セッション ID

§

BidiStreamData

双方向ストリームデータ受信

Fields

§stream_id: u64

QUIC ストリーム ID

§data: Vec<u8>

データ

§

BidiStreamEnd

双方向ストリーム終了 (FIN 受信)

Fields

§stream_id: u64

QUIC ストリーム ID

§

UniStreamOpen

単方向ストリーム開始 (draft-ietf-webtrans-http3-15 Section 4.2)

Fields

§stream_id: u64

QUIC ストリーム ID

§session_id: u64

WebTransport セッション ID

§

UniStreamData

単方向ストリームデータ受信

Fields

§stream_id: u64

QUIC ストリーム ID

§data: Vec<u8>

データ

§

UniStreamEnd

単方向ストリーム終了 (FIN 受信)

Fields

§stream_id: u64

QUIC ストリーム ID

§

SessionClosed

セッション終了 (draft-ietf-webtrans-http3-15 Section 6)

セッションが終了した。reset_streams に含まれる全ストリームに対して error_code を使用して RESET_STREAM_AT (reliable_size を伴う) と STOP_SENDING を送信すること。reset_stream_at transport parameter が ネゴシエートされていない経路では通常の RESET_STREAM にフォールバックする。

Fields

§session_id: u64

セッション ID (CONNECT ストリーム ID)

§reset_streams: Vec<WtStreamReset>

リセットすべきストリーム情報の一覧 (stream_id と reliable_size)

§error_code: u64

RESET_STREAM / STOP_SENDING に使用するエラーコード (WT_SESSION_GONE / WT_ALPN_ERROR 等)

§close_error_code: u32

WT_CLOSE_SESSION カプセルのアプリケーションエラーコード (draft-ietf-webtrans-http3-15 Section 6) WT_CLOSE_SESSION なしの終了 (FIN / RESET_STREAM) の場合は 0

§close_message: String

WT_CLOSE_SESSION カプセルのエラーメッセージ (draft-ietf-webtrans-http3-15 Section 6) WT_CLOSE_SESSION なしの終了の場合は空文字列

§

SessionEstablished

セッション確立 (draft-ietf-webtrans-http3-15 Section 3)

CONNECT ストリームに 200 OK が返された。 バッファリングされていたストリーム/データグラムがあれば配送される。

Fields

§session_id: u64

セッション ID (CONNECT ストリーム ID)

§flow_control_enabled: bool

フロー制御が有効かどうか (Section 5.1)

両端が SETTINGS でフロー制御を宣言した場合に truetrue の場合、接続層がストリーム数/データ量の超過を検知し、 WT_MAX_STREAMS / WT_MAX_DATA カプセルの生成を行う。

§

SessionDraining

セッション draining (draft-ietf-webtrans-http3-15 Section 4.7)

WT_DRAIN_SESSION カプセルを受信した。 Section 4.7 では MAY continue だが、本実装はアプリ層の早期終了を促すため 新規ストリームやデータグラムの送信を拒否する。 セッションは即座に終了しないが、グレースフルシャットダウンを開始する。

Fields

§session_id: u64

セッション ID (CONNECT ストリーム ID)

§

Capsule

フロー制御カプセル受信 (draft-ietf-webtrans-http3-15 Section 5.6)

CONNECT ストリーム上でフロー制御カプセルを受信した。 上位層は webtransport::Session::process_capsule に渡すこと。

Fields

§session_id: u64

WebTransport セッション ID

§capsule: Capsule

受信した Capsule

§

Datagram

データグラム受信 (draft-ietf-webtrans-http3-15 Section 4.5)

QUIC DATAGRAM フレームから WebTransport データグラムを受信した。

Fields

§session_id: u64

WebTransport セッション ID

§payload: Vec<u8>

データグラムペイロード

§

StreamReset

データストリームのリセット受信 (draft-ietf-webtrans-http3-15 Section 4.4)

WebTransport セッションに属するデータストリームに対して RESET_STREAM を 受信した。アプリケーション層はセッション ID と application error code を 元にアプリへ通知すること。

Fields

§session_id: u64

WebTransport セッション ID

§stream_id: u64

QUIC ストリーム ID

§error_code: u64

QUIC application error code

§final_size: u64

QUIC RESET_STREAM の final size (RFC 9000 Section 19.4)

reset_stream_at transport parameter がネゴシエートされている場合、 この値は stream header (stream type / signal value + session_id varint) のバイト数以上であることが期待される (draft-ietf-webtrans-http3-15 Section 4.4)。

§

StreamStopSending

データストリームへの STOP_SENDING 受信 (draft-ietf-webtrans-http3-15 Section 4.4)

Fields

§session_id: u64

WebTransport セッション ID

§stream_id: u64

QUIC ストリーム ID

§error_code: u64

QUIC application error code

§

BufferedStreamRejected

バッファリング拒否 (draft-ietf-webtrans-http3-15 Section 4.6)

バッファリング上限を超えたため、error_code を使用して RESET_STREAM / STOP_SENDING を送信すること。

Fields

§stream_id: u64

拒否されたストリーム ID

§error_code: u64

RESET_STREAM / STOP_SENDING に使用するエラーコード (WT_BUFFERED_STREAM_REJECTED)

Implementations§

Source§

impl WebTransportEvent

Source

pub fn stream_id(&self) -> Option<u64>

ストリーム ID を取得 (存在する場合)

Trait Implementations§

Source§

impl Clone for WebTransportEvent

Source§

fn clone(&self) -> WebTransportEvent

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WebTransportEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for WebTransportEvent

Source§

impl PartialEq for WebTransportEvent

Source§

fn eq(&self, other: &WebTransportEvent) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for WebTransportEvent

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.