pub struct Service<T> { /* private fields */ }
Expand description
An abstraction of p2p service, currently only supports TCP/websocket protocol
Implementations
sourceimpl<T> Service<T> where
T: ServiceHandle + Unpin,
impl<T> Service<T> where
T: ServiceHandle + Unpin,
sourcepub fn yamux_config(self, config: YamuxConfig) -> Self
pub fn yamux_config(self, config: YamuxConfig) -> Self
Yamux config for service
Panic when max_frame_length < yamux_max_window_size
sourcepub fn max_frame_length(self, size: usize) -> Self
pub fn max_frame_length(self, size: usize) -> Self
Secio max frame length
Panic when max_frame_length < yamux_max_window_size
sourcepub async fn listen(
&mut self,
address: Multiaddr
) -> Result<Multiaddr, TransportErrorKind>
pub async fn listen(
&mut self,
address: Multiaddr
) -> Result<Multiaddr, TransportErrorKind>
Listen on the given address.
Return really listen multiaddr, but if use /dns4/localhost/tcp/80
,
it will return original value, and create a future task to DNS resolver later.
sourcepub async fn dial(
&mut self,
address: Multiaddr,
target: TargetProtocol
) -> Result<&mut Self, TransportErrorKind>
pub async fn dial(
&mut self,
address: Multiaddr,
target: TargetProtocol
) -> Result<&mut Self, TransportErrorKind>
Dial the given address, doesn’t actually make a request, just generate a future
sourcepub fn control(&self) -> &ServiceAsyncControl
pub fn control(&self) -> &ServiceAsyncControl
Get service control, control can send tasks externally to the runtime inside
Auto Trait Implementations
impl<T> !RefUnwindSafe for Service<T>
impl<T> Send for Service<T> where
T: Send,
impl<T> !Sync for Service<T>
impl<T> Unpin for Service<T> where
T: Unpin,
impl<T> !UnwindSafe for Service<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn 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>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more