pub struct UnauthedEthStream<S> { /* private fields */ }Expand description
Implementations§
Source§impl<S> UnauthedEthStream<S>
impl<S> UnauthedEthStream<S>
Sourcepub const fn new(inner: S) -> Self
pub const fn new(inner: S) -> Self
Create a new UnauthedEthStream from a type S which implements Stream and Sink.
Sourcepub fn into_inner(self) -> S
pub fn into_inner(self) -> S
Consumes the type and returns the wrapped stream
Source§impl<S, E> UnauthedEthStream<S>where
S: Stream<Item = Result<BytesMut, E>> + CanDisconnect<Bytes> + Send,
EthStreamError: From<E> + From<<S as Sink<Bytes>>::Error>,
impl<S, E> UnauthedEthStream<S>where
S: Stream<Item = Result<BytesMut, E>> + CanDisconnect<Bytes> + Send,
EthStreamError: From<E> + From<<S as Sink<Bytes>>::Error>,
Sourcepub async fn handshake<N: NetworkPrimitives>(
self,
status: UnifiedStatus,
fork_filter: ForkFilter,
) -> Result<(EthStream<S, N>, UnifiedStatus), EthStreamError>
pub async fn handshake<N: NetworkPrimitives>( self, status: UnifiedStatus, fork_filter: ForkFilter, ) -> Result<(EthStream<S, N>, UnifiedStatus), EthStreamError>
Consumes the UnauthedEthStream and returns an EthStream after the Status
handshake is completed successfully. This also returns the Status message sent by the
remote peer.
Caution: This expects that the UnifiedStatus has the proper eth version configured, with
ETH69 the initial status message changed.
Sourcepub async fn handshake_with_timeout<N: NetworkPrimitives>(
self,
status: UnifiedStatus,
fork_filter: ForkFilter,
timeout_limit: Duration,
) -> Result<(EthStream<S, N>, UnifiedStatus), EthStreamError>
pub async fn handshake_with_timeout<N: NetworkPrimitives>( self, status: UnifiedStatus, fork_filter: ForkFilter, timeout_limit: Duration, ) -> Result<(EthStream<S, N>, UnifiedStatus), EthStreamError>
Wrapper around handshake which enforces a timeout.
Sourcepub async fn handshake_without_timeout<N: NetworkPrimitives>(
self,
status: UnifiedStatus,
fork_filter: ForkFilter,
) -> Result<(EthStream<S, N>, UnifiedStatus), EthStreamError>
pub async fn handshake_without_timeout<N: NetworkPrimitives>( self, status: UnifiedStatus, fork_filter: ForkFilter, ) -> Result<(EthStream<S, N>, UnifiedStatus), EthStreamError>
Handshake with no timeout
Trait Implementations§
Source§impl<S: Debug> Debug for UnauthedEthStream<S>
impl<S: Debug> Debug for UnauthedEthStream<S>
impl<'pin, S> Unpin for UnauthedEthStream<S>where
PinnedFieldsOf<__UnauthedEthStream<'pin, S>>: Unpin,
Auto Trait Implementations§
impl<S> Freeze for UnauthedEthStream<S>where
S: Freeze,
impl<S> RefUnwindSafe for UnauthedEthStream<S>where
S: RefUnwindSafe,
impl<S> Send for UnauthedEthStream<S>where
S: Send,
impl<S> Sync for UnauthedEthStream<S>where
S: Sync,
impl<S> UnsafeUnpin for UnauthedEthStream<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for UnauthedEthStream<S>where
S: 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn 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>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.