pub struct SimplePlugin { /* private fields */ }Expand description
A plugin assembled from declarative values or functions of existing values.
Scalar values replace the corresponding option, while collection values append. Functions receive the existing field and replace it with their return value, except that returned workflow definitions are merged into the existing definitions.
use temporalio_client::ClientOptions;
use temporalio_common::data_converters::DataConverter;
use temporalio_sdk::SimplePlugin;
let plugin = SimplePlugin::builder("my-plugin")
.data_converter(|existing: Option<DataConverter>| existing.unwrap_or_default())
.build();
let client_options = ClientOptions::new("default").plugin(plugin).build();Worker configuration declared by this combined plugin is automatically propagated through the configured client when a worker is created.
Experimental: This API may change or be removed.
Implementations§
Source§impl SimplePlugin
impl SimplePlugin
Sourcepub fn builder(name: impl Into<String>) -> SimplePluginBuilder
pub fn builder(name: impl Into<String>) -> SimplePluginBuilder
Create an instance of SimplePlugin using the builder syntax
Trait Implementations§
Source§impl ClientPlugin for SimplePlugin
impl ClientPlugin for SimplePlugin
Source§fn name(&self) -> &str
fn name(&self) -> &str
Return the stable, unique name used to identify this plugin in diagnostics and worker
heartbeats.
Source§fn configure_client_options(
&self,
options: &mut ClientOptions,
) -> Result<(), PluginError>
fn configure_client_options( &self, options: &mut ClientOptions, ) -> Result<(), PluginError>
Configure options before the namespace-bound client is created.
Source§fn configure_connection_options(
&self,
_options: &mut ConnectionOptions,
) -> Result<(), PluginError>
fn configure_connection_options( &self, _options: &mut ConnectionOptions, ) -> Result<(), PluginError>
Configure options before the connection is established.
Source§impl Clone for SimplePlugin
impl Clone for SimplePlugin
Source§fn clone(&self) -> SimplePlugin
fn clone(&self) -> SimplePlugin
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl From<SimplePlugin> for ErasedClientPlugin
impl From<SimplePlugin> for ErasedClientPlugin
Source§fn from(plugin: SimplePlugin) -> Self
fn from(plugin: SimplePlugin) -> Self
Converts to this type from the input type.
Source§impl WorkerPlugin for SimplePlugin
impl WorkerPlugin for SimplePlugin
Source§fn configure_worker_options(
&self,
options: &mut WorkerOptions,
) -> Result<(), PluginError>
fn configure_worker_options( &self, options: &mut WorkerOptions, ) -> Result<(), PluginError>
Configure worker options. Read more
Source§fn configure_workflow_replayer_options(
&self,
options: &mut WorkflowReplayerOptions,
) -> Result<(), PluginError>
fn configure_workflow_replayer_options( &self, options: &mut WorkflowReplayerOptions, ) -> Result<(), PluginError>
Configure workflow replayer options. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for SimplePlugin
impl !UnwindSafe for SimplePlugin
impl Freeze for SimplePlugin
impl Send for SimplePlugin
impl Sync for SimplePlugin
impl Unpin for SimplePlugin
impl UnsafeUnpin for SimplePlugin
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
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> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request