pub struct Service<T> { /* private fields */ }Expand description
Concrete Restate service implementation over a transport resolver.
Most applications construct this once at worker startup, register one or
more transports in a StaticTransportRegistry,
and bind it to a Restate endpoint through
IntoServiceDefinition.
Implementations§
Source§impl<T> Service<T>
impl<T> Service<T>
Build a service around a shared transport resolver.
Sourcepub fn with_transport_options(
self,
transport_options: TransportOptionRegistry,
) -> Self
pub fn with_transport_options( self, transport_options: TransportOptionRegistry, ) -> Self
Override the provider-option registry used to hydrate queued
transport_options.
The default registry is email_kit::transport::transport_option_registry();
use this method when a worker has additional provider-specific option
types outside email-kit.
Sourcepub async fn send_request(
&self,
request: &SendRequest,
) -> Result<SendResponse, HandlerError>
pub async fn send_request( &self, request: &SendRequest, ) -> Result<SendResponse, HandlerError>
Send one email request through the configured worker dependencies.
§Errors
Returns HandlerError when the requested transport key is unknown or
sending fails. Unknown transport keys and non-retryable transport
failures become Restate terminal errors; retryable transport failures
remain retryable handler errors.
Trait Implementations§
Source§impl<T> Discoverable for Service<T>
impl<T> Discoverable for Service<T>
Source§impl<T> IntoServiceDefinition for Service<T>
impl<T> IntoServiceDefinition for Service<T>
fn into_service_definition(self) -> ServiceDefinition
Auto Trait Implementations§
impl<T> Freeze for Service<T>
impl<T> RefUnwindSafe for Service<T>where
Arc<T>: RefUnwindSafe,
impl<T> Send for Service<T>
impl<T> Sync for Service<T>
impl<T> Unpin for Service<T>
impl<T> UnsafeUnpin for Service<T>where
Arc<T>: UnsafeUnpin,
impl<T> UnwindSafe for Service<T>where
Arc<T>: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> 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> ⓘ
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> ⓘ
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