pub struct ConnectRequest<Z: NetworkZone> {
pub addr: Z::Addr,
pub permit: Option<OwnedSemaphorePermit>,
}Expand description
A request to connect to a peer.
Fields§
§addr: Z::AddrThe peer’s address.
permit: Option<OwnedSemaphorePermit>A permit which will be held be the connection allowing you to set limits on the number of connections.
This doesn’t have to be set.
Trait Implementations§
Source§impl<Z: NetworkZone, T, AdrBook, CSync, ProtoHdlrMkr, BrdcstStrmMkr, BrdcstStrm> Service<ConnectRequest<Z>> for Connector<Z, T, AdrBook, CSync, ProtoHdlrMkr, BrdcstStrmMkr>where
T: Transport<Z>,
AdrBook: AddressBook<Z> + Clone,
CSync: CoreSyncSvc + Clone,
ProtoHdlrMkr: ProtocolRequestHandlerMaker<Z> + Clone,
BrdcstStrm: Stream<Item = BroadcastMessage> + Send + 'static,
BrdcstStrmMkr: Fn(InternalPeerID<Z::Addr>) -> BrdcstStrm + Clone + Send + 'static,
impl<Z: NetworkZone, T, AdrBook, CSync, ProtoHdlrMkr, BrdcstStrmMkr, BrdcstStrm> Service<ConnectRequest<Z>> for Connector<Z, T, AdrBook, CSync, ProtoHdlrMkr, BrdcstStrmMkr>where
T: Transport<Z>,
AdrBook: AddressBook<Z> + Clone,
CSync: CoreSyncSvc + Clone,
ProtoHdlrMkr: ProtocolRequestHandlerMaker<Z> + Clone,
BrdcstStrm: Stream<Item = BroadcastMessage> + Send + 'static,
BrdcstStrmMkr: Fn(InternalPeerID<Z::Addr>) -> BrdcstStrm + Clone + Send + 'static,
Source§type Error = HandshakeError
type Error = HandshakeError
Errors produced by the service.
Source§type Future = Pin<Box<dyn Future<Output = Result<<Connector<Z, T, AdrBook, CSync, ProtoHdlrMkr, BrdcstStrmMkr> as Service<ConnectRequest<Z>>>::Response, <Connector<Z, T, AdrBook, CSync, ProtoHdlrMkr, BrdcstStrmMkr> as Service<ConnectRequest<Z>>>::Error>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<<Connector<Z, T, AdrBook, CSync, ProtoHdlrMkr, BrdcstStrmMkr> as Service<ConnectRequest<Z>>>::Response, <Connector<Z, T, AdrBook, CSync, ProtoHdlrMkr, BrdcstStrmMkr> as Service<ConnectRequest<Z>>>::Error>> + Send>>
The future response value.
Source§fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
Returns
Poll::Ready(Ok(())) when the service is able to process requests. Read moreSource§fn call(&mut self, req: ConnectRequest<Z>) -> Self::Future
fn call(&mut self, req: ConnectRequest<Z>) -> Self::Future
Process the request and return the response asynchronously. Read more
Auto Trait Implementations§
impl<Z> !RefUnwindSafe for ConnectRequest<Z>
impl<Z> !UnwindSafe for ConnectRequest<Z>
impl<Z> Freeze for ConnectRequest<Z>
impl<Z> Send for ConnectRequest<Z>
impl<Z> Sync for ConnectRequest<Z>
impl<Z> Unpin for ConnectRequest<Z>
impl<Z> UnsafeUnpin for ConnectRequest<Z>
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.