pub struct Service<T>where
T: ClientImpl,{ /* private fields */ }Available on crate feature
client only.Expand description
The service which drives a connection.
This is constructed through connect() and has to be driven by calling
Service::run.
Implementations§
Source§impl<T> Service<T>where
T: ClientImpl,
impl<T> Service<T>where
T: ClientImpl,
Sourcepub fn handle(&self) -> &Handle
pub fn handle(&self) -> &Handle
Get a handle to the service.
The returned handle can be cloned and moved freely between tasks.
Sourcepub async fn run(&mut self) -> Result<(), Error>
pub async fn run(&mut self) -> Result<(), Error>
Run the service.
This drives the underlying connection and must be called for any requests to be processed. It is typically spawned onto a task of its own.
Unless disabled through ServiceBuilder::reconnect, a connection
which is lost is re-established with an exponential backoff. Any
requests which were in flight at that point are failed.
This returns once Handle::close has been called, or the connection
has been lost while reconnecting is disabled.
Trait Implementations§
Source§impl<T> Debug for Service<T>where
T: ClientImpl,
impl<T> Debug for Service<T>where
T: ClientImpl,
Source§impl<T> Drop for Service<T>where
T: ClientImpl,
impl<T> Drop for Service<T>where
T: ClientImpl,
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Service<T>
impl<T> !UnwindSafe for Service<T>
impl<T> Freeze for Service<T>where
<T as ClientImpl>::Socket: Freeze,
impl<T> Send for Service<T>
impl<T> Sync for Service<T>where
<T as ClientImpl>::Socket: Sync,
impl<T> Unpin for Service<T>where
<T as ClientImpl>::Socket: Unpin,
impl<T> UnsafeUnpin for Service<T>where
<T as ClientImpl>::Socket: UnsafeUnpin,
Blanket Implementations§
impl<Token, Builder, How> AllPropsFor<Builder, How> for Tokenwhere
Builder: Buildable<Token>,
<Builder as Buildable<Token>>::WrappedToken: HasAllProps<<Builder as Buildable<Token>>::Output, How>,
impl<Token, Builder, How> AllPropsFor<Builder, How> for Tokenwhere
Builder: Buildable<Token>,
<Builder as Buildable<Token>>::WrappedToken: HasAllProps<<Builder as Buildable<Token>>::Output, How>,
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> HasAllProps<(), T> for T
impl<T> HasAllProps<(), T> for T
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> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
Convert
self to a value of a Properties struct.Source§impl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
Convert
self to a value of a Properties struct.Source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
Convert
self to a value of a Properties struct.Source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
Convert
self to a value of a Properties struct.