pub struct ServiceBuilder<T, E> { /* private fields */ }client only.Implementations§
Source§impl<T, E> ServiceBuilder<T, E>
impl<T, E> ServiceBuilder<T, E>
Sourcepub fn on_error<U>(self, on_error: U) -> ServiceBuilder<T, U>
pub fn on_error<U>(self, on_error: U) -> ServiceBuilder<T, U>
Set the error handler to use for the service.
Errors which are reported here are errors which cannot be associated with a particular request, such as a failure to connect or a message which could not be decoded.
Sourcepub fn format(self, format: Format) -> Self
pub fn format(self, format: Format) -> Self
Set the Format to use for message bodies.
The format is negotiated with the server once the connection is
established, see the negotiation protocol. If the server does not
support it the error is reported through ServiceBuilder::on_error
and the connection falls back to Format::DEFAULT, which can be
observed through Handle::format.
Defaults to Format::DEFAULT.
Sourcepub fn reconnect(self, reconnect: bool) -> Self
pub fn reconnect(self, reconnect: bool) -> Self
Configure whether the service should try to reconnect when the connection is lost.
This defaults to true. If this is disabled, Service::run returns
once the connection has been lost or could not be established.
Sourcepub fn seed(self, seed: u64) -> Self
pub fn seed(self, seed: u64) -> Self
Associate the specified seed with the service.
This affects the random fuzzing which is applied to reconnect timeouts.
By default the seed is a constant value.
Sourcepub fn build(self) -> Service<T>
pub fn build(self) -> Service<T>
Build the service.
Note that no connection is established until Service::run is called.
Auto Trait Implementations§
impl<T, E> Freeze for ServiceBuilder<T, E>where
E: Freeze,
impl<T, E> RefUnwindSafe for ServiceBuilder<T, E>where
E: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, E> Send for ServiceBuilder<T, E>
impl<T, E> Sync for ServiceBuilder<T, E>
impl<T, E> Unpin for ServiceBuilder<T, E>
impl<T, E> UnsafeUnpin for ServiceBuilder<T, E>where
E: UnsafeUnpin,
impl<T, E> UnwindSafe for ServiceBuilder<T, E>where
E: UnwindSafe,
T: UnwindSafe,
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
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>
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>
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
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
self to a value of a Properties struct.