pub struct SubstreamProtocol<TUpgr, TData> { /* private fields */ }Implementations§
Source§impl<TUpgr, TData> SubstreamProtocol<TUpgr, TData>
impl<TUpgr, TData> SubstreamProtocol<TUpgr, TData>
pub fn new(upgrade: TUpgr, data: TData) -> Self
pub fn upgrade(&self) -> &TUpgr
pub fn timeout(&self) -> &Duration
pub fn with_timeout(self, timeout: Duration) -> Self
pub fn into_inner(self) -> (TUpgr, TData, Duration)
pub fn map_upgrade<U, F>(self, f: F) -> SubstreamProtocol<U, TData>where
F: FnOnce(TUpgr) -> U,
pub fn map_user_data<U, F>(self, f: F) -> SubstreamProtocol<TUpgr, U>where
F: FnOnce(TData) -> U,
Trait Implementations§
Source§impl<TUpgr: Clone, TData: Clone> Clone for SubstreamProtocol<TUpgr, TData>
impl<TUpgr: Clone, TData: Clone> Clone for SubstreamProtocol<TUpgr, TData>
Source§fn clone(&self) -> SubstreamProtocol<TUpgr, TData>
fn clone(&self) -> SubstreamProtocol<TUpgr, TData>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<TUpgr: PartialEq, TData: PartialEq> PartialEq for SubstreamProtocol<TUpgr, TData>
impl<TUpgr: PartialEq, TData: PartialEq> PartialEq for SubstreamProtocol<TUpgr, TData>
Source§fn eq(&self, other: &SubstreamProtocol<TUpgr, TData>) -> bool
fn eq(&self, other: &SubstreamProtocol<TUpgr, TData>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<TUpgr: Copy, TData: Copy> Copy for SubstreamProtocol<TUpgr, TData>
impl<TUpgr: Eq, TData: Eq> Eq for SubstreamProtocol<TUpgr, TData>
impl<TUpgr, TData> StructuralPartialEq for SubstreamProtocol<TUpgr, TData>
Auto Trait Implementations§
impl<TUpgr, TData> Freeze for SubstreamProtocol<TUpgr, TData>
impl<TUpgr, TData> RefUnwindSafe for SubstreamProtocol<TUpgr, TData>where
TUpgr: RefUnwindSafe,
TData: RefUnwindSafe,
impl<TUpgr, TData> Send for SubstreamProtocol<TUpgr, TData>
impl<TUpgr, TData> Sync for SubstreamProtocol<TUpgr, TData>
impl<TUpgr, TData> Unpin for SubstreamProtocol<TUpgr, TData>
impl<TUpgr, TData> UnwindSafe for SubstreamProtocol<TUpgr, TData>where
TUpgr: UnwindSafe,
TData: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more