Struct StreamId

pub struct StreamId(/* private field */);

A stream identifier, as described in Section 5.1.1 of RFC 7540.

Streams are identified with an unsigned 31-bit integer. Streams initiated by a client MUST use odd-numbered stream identifiers; those initiated by the server MUST use even-numbered stream identifiers. A stream identifier of zero (0x0) is used for connection control messages; the stream identifier of zero cannot be used to establish a new stream.

Implementations

impl StreamId

fn as_u32(&self) -> u32

Returns the u32 corresponding to this StreamId

Note

This is the same as the From<StreamId> implementation, but included as an inherent method because that implementation doesn't appear in rustdocs, as well as a way to force the type instead of relying on inference.

Trait Implementations

impl Clone for StreamId

fn clone(&self) -> StreamId

impl Copy for StreamId

impl Debug for StreamId

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

impl Eq for StreamId

impl Hash for StreamId

fn hash<__H: Hasher>(&self, state: &mut __H)

impl PartialEq for StreamId

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

impl StructuralPartialEq for StreamId

Auto Trait Implementations

impl Freeze for StreamId

impl RefUnwindSafe for StreamId

impl Send for StreamId

impl Sync for StreamId

impl Unpin for StreamId

impl UnsafeUnpin for StreamId

impl UnwindSafe for StreamId

Blanket Implementations

impl<Q, K> Equivalent<K> for StreamId where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

fn equivalent(&self, key: &K) -> bool

impl<Q, K> Equivalent<K> for StreamId where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

fn equivalent(&self, key: &K) -> bool

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

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

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

impl<T> From<T> for StreamId

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Instrument for StreamId

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

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T> WithSubscriber for StreamId

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

fn into(self) -> U

Calls U::from(self).

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

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

type Error = never;
fn try_from(value: U) -> Result<T, never>

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

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