pub trait ClientConfigBuilder: CoreClientConfigBuilder {
Show 18 methods
// Required methods
fn add(&mut self, config: ClientConfig) -> &mut Self;
fn add_env(&mut self, uri: Uri, env: Vec<u8>) -> &mut Self;
fn add_envs(&mut self, env: HashMap<Uri, Vec<u8>>) -> &mut Self;
fn remove_env(&mut self, uri: &Uri) -> &mut Self;
fn add_interface_implementation(
&mut self,
interface_uri: Uri,
implementation_uri: Uri
) -> &mut Self;
fn add_interface_implementations(
&mut self,
interface_uri: Uri,
implementation_uris: Vec<Uri>
) -> &mut Self;
fn remove_interface_implementation(
&mut self,
interface_uri: &Uri,
implementation_uri: &Uri
) -> &mut Self;
fn add_wrapper(&mut self, uri: Uri, wrapper: Arc<dyn Wrapper>) -> &mut Self;
fn add_wrappers(
&mut self,
wrappers: Vec<(Uri, Arc<dyn Wrapper>)>
) -> &mut Self;
fn remove_wrapper(&mut self, uri: &Uri) -> &mut Self;
fn add_package(
&mut self,
uri: Uri,
package: Arc<dyn WrapPackage>
) -> &mut Self;
fn add_packages(
&mut self,
packages: Vec<(Uri, Arc<dyn WrapPackage>)>
) -> &mut Self;
fn remove_package(&mut self, uri: &Uri) -> &mut Self;
fn add_redirect(&mut self, from: Uri, to: Uri) -> &mut Self;
fn add_redirects(&mut self, redirects: HashMap<Uri, Uri>) -> &mut Self;
fn remove_redirect(&mut self, from: &Uri) -> &mut Self;
fn add_resolver(&mut self, resolver: Arc<dyn UriResolver>) -> &mut Self;
fn add_resolvers(
&mut self,
resolvers: Vec<Arc<dyn UriResolver>>
) -> &mut Self;
}
Expand description
Defines a type that uses the builder pattern to build a ClientConfig
.
Required Methods§
sourcefn add(&mut self, config: ClientConfig) -> &mut Self
fn add(&mut self, config: ClientConfig) -> &mut Self
Merges a ClientConfig
with the current instance’s state.
Arguments
config
- AClientConfig
instance to be merged with the current state.
sourcefn add_env(&mut self, uri: Uri, env: Vec<u8>) -> &mut Self
fn add_env(&mut self, uri: Uri, env: Vec<u8>) -> &mut Self
Adds an environment configuration entry.
Arguments
uri
- TheUri
associated with the environment configuration.env
- A msgpack buffer representing the environment configuration.
sourcefn add_envs(&mut self, env: HashMap<Uri, Vec<u8>>) -> &mut Self
fn add_envs(&mut self, env: HashMap<Uri, Vec<u8>>) -> &mut Self
Adds several environment configuration entries.
Arguments
env
- A HashMap where the key is theUri
and the value is a msgpack buffer representing the environment configuration.
sourcefn remove_env(&mut self, uri: &Uri) -> &mut Self
fn remove_env(&mut self, uri: &Uri) -> &mut Self
Removes an environment entry by Uri
.
Arguments
uri
- TheUri
of the environment entry to be removed.
sourcefn add_interface_implementation(
&mut self,
interface_uri: Uri,
implementation_uri: Uri
) -> &mut Self
fn add_interface_implementation( &mut self, interface_uri: Uri, implementation_uri: Uri ) -> &mut Self
Adds an interface implementation entry.
Arguments
interface_uri
- TheUri
of the interface.implementation_uri
- TheUri
of the implementation.
sourcefn add_interface_implementations(
&mut self,
interface_uri: Uri,
implementation_uris: Vec<Uri>
) -> &mut Self
fn add_interface_implementations( &mut self, interface_uri: Uri, implementation_uris: Vec<Uri> ) -> &mut Self
Adds several interface implementations.
Arguments
interface_uri
- TheUri
of the interface.implementation_uris
- A list of implementationUri
s.
sourcefn remove_interface_implementation(
&mut self,
interface_uri: &Uri,
implementation_uri: &Uri
) -> &mut Self
fn remove_interface_implementation( &mut self, interface_uri: &Uri, implementation_uri: &Uri ) -> &mut Self
Removes an implementation from an interface.
Arguments
interface_uri
- TheUri
of the interface.implementation_uri
- TheUri
of the implementation to be removed.
sourcefn add_wrapper(&mut self, uri: Uri, wrapper: Arc<dyn Wrapper>) -> &mut Self
fn add_wrapper(&mut self, uri: Uri, wrapper: Arc<dyn Wrapper>) -> &mut Self
Embeds a wrapper to the config.
When invoking this wrapper’s Uri
, it won’t be fetched at runtime; but taken from the config instead.
Arguments
uri
- TheUri
of theWrapper
.wrapper
- AWrapper
instance.
sourcefn add_wrappers(&mut self, wrappers: Vec<(Uri, Arc<dyn Wrapper>)>) -> &mut Self
fn add_wrappers(&mut self, wrappers: Vec<(Uri, Arc<dyn Wrapper>)>) -> &mut Self
Embeds several wrappers to the config.
Arguments
wrappers
- A list of tuples where each tuple contains aUri
and aWrapper
instance.
sourcefn remove_wrapper(&mut self, uri: &Uri) -> &mut Self
fn remove_wrapper(&mut self, uri: &Uri) -> &mut Self
sourcefn add_package(&mut self, uri: Uri, package: Arc<dyn WrapPackage>) -> &mut Self
fn add_package(&mut self, uri: Uri, package: Arc<dyn WrapPackage>) -> &mut Self
Embeds a WrapPackage
to the config.
When invoking this package’s Uri
, the embedded local instance will create a Wrapper
and invoke it.
Arguments
uri
- TheUri
of theWrapPackage
.package
- AWrapPackage
instance.
sourcefn add_packages(
&mut self,
packages: Vec<(Uri, Arc<dyn WrapPackage>)>
) -> &mut Self
fn add_packages( &mut self, packages: Vec<(Uri, Arc<dyn WrapPackage>)> ) -> &mut Self
Embeds several WrapPackage
s to the config.
Arguments
packages
- A list of tuples where each tuple contains aUri
and aWrapPackage
instance.
sourcefn remove_package(&mut self, uri: &Uri) -> &mut Self
fn remove_package(&mut self, uri: &Uri) -> &mut Self
sourcefn add_redirect(&mut self, from: Uri, to: Uri) -> &mut Self
fn add_redirect(&mut self, from: Uri, to: Uri) -> &mut Self
Specifies a Uri
that should be redirected to another Uri
.
Arguments
from
- The originalUri
.to
- TheUri
to which the originalUri
should be redirected.
sourcefn add_redirects(&mut self, redirects: HashMap<Uri, Uri>) -> &mut Self
fn add_redirects(&mut self, redirects: HashMap<Uri, Uri>) -> &mut Self
Specifies multiple Uri
s that should be redirected to other Uri
s.
Arguments
redirects
- A HashMap where the key is the originalUri
and the value is theUri
to which it should be redirected.
sourcefn remove_redirect(&mut self, from: &Uri) -> &mut Self
fn remove_redirect(&mut self, from: &Uri) -> &mut Self
Removes a previously added redirect from one Uri
to another.
Arguments
from
- The originalUri
of the redirect to be removed.
sourcefn add_resolver(&mut self, resolver: Arc<dyn UriResolver>) -> &mut Self
fn add_resolver(&mut self, resolver: Arc<dyn UriResolver>) -> &mut Self
sourcefn add_resolvers(&mut self, resolvers: Vec<Arc<dyn UriResolver>>) -> &mut Self
fn add_resolvers(&mut self, resolvers: Vec<Arc<dyn UriResolver>>) -> &mut Self
Adds multiple custom Uri
resolvers to the configuration.
Arguments
resolvers
- A list of UriResolver instances.