pub struct ClientConfig {
pub interfaces: Option<InterfaceImplementations>,
pub envs: Option<HashMap<Uri, Vec<u8>>>,
pub wrappers: Option<Vec<(Uri, Arc<dyn Wrapper>)>>,
pub packages: Option<Vec<(Uri, Arc<dyn WrapPackage>)>>,
pub redirects: Option<HashMap<Uri, Uri>>,
pub resolvers: Option<Vec<Arc<dyn UriResolver>>>,
}
Expand description
Struct representing the configuration of a Client
.
Fields§
§interfaces: Option<InterfaceImplementations>
§envs: Option<HashMap<Uri, Vec<u8>>>
§wrappers: Option<Vec<(Uri, Arc<dyn Wrapper>)>>
§packages: Option<Vec<(Uri, Arc<dyn WrapPackage>)>>
§redirects: Option<HashMap<Uri, Uri>>
§resolvers: Option<Vec<Arc<dyn UriResolver>>>
Implementations§
source§impl ClientConfig
impl ClientConfig
pub fn new() -> Self
pub fn build_static_resolver(&self) -> Option<StaticResolver>
Trait Implementations§
source§impl ClientConfigBuilder for ClientConfig
impl ClientConfigBuilder for ClientConfig
source§fn add(&mut self, config: ClientConfig) -> &mut Self
fn add(&mut self, config: ClientConfig) -> &mut Self
Merges a
ClientConfig
with the current instance’s state. Read moresource§fn 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. Read more
source§fn add_envs(&mut self, envs: HashMap<Uri, Vec<u8>>) -> &mut Self
fn add_envs(&mut self, envs: HashMap<Uri, Vec<u8>>) -> &mut Self
Adds several environment configuration entries. Read more
source§fn remove_env(&mut self, uri: &Uri) -> &mut Self
fn remove_env(&mut self, uri: &Uri) -> &mut Self
Removes an environment entry by
Uri
. Read moresource§fn 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. Read more
source§fn 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. Read more
source§fn 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. Read more
source§fn 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. Read moresource§fn 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. Read more
source§fn remove_wrapper(&mut self, uri: &Uri) -> &mut Self
fn remove_wrapper(&mut self, uri: &Uri) -> &mut Self
Removes an embedded wrapper. Read more
source§fn 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. Read moresource§fn 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. Read moresource§fn remove_package(&mut self, uri: &Uri) -> &mut Self
fn remove_package(&mut self, uri: &Uri) -> &mut Self
Removes an embedded
WrapPackage
. Read moresource§fn add_redirect(&mut self, from: Uri, to: Uri) -> &mut Self
fn add_redirect(&mut self, from: Uri, to: Uri) -> &mut Self
source§fn add_redirects(&mut self, redirects: HashMap<Uri, Uri>) -> &mut Self
fn add_redirects(&mut self, redirects: HashMap<Uri, Uri>) -> &mut Self
source§fn 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. Read moresource§fn add_resolver(&mut self, resolver: Arc<dyn UriResolver>) -> &mut Self
fn add_resolver(&mut self, resolver: Arc<dyn UriResolver>) -> &mut Self
Adds a custom
Uri
resolver to the configuration. Read moresource§fn 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. Read moresource§impl Clone for ClientConfig
impl Clone for ClientConfig
source§fn clone(&self) -> ClientConfig
fn clone(&self) -> ClientConfig
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl CoreClientConfigBuilder for ClientConfig
impl CoreClientConfigBuilder for ClientConfig
source§fn build(self) -> CoreClientConfig
fn build(self) -> CoreClientConfig
Builds a
CoreClientConfig
instance.source§impl Default for ClientConfig
impl Default for ClientConfig
source§fn default() -> ClientConfig
fn default() -> ClientConfig
Returns the “default value” for a type. Read more
source§impl Into<CoreClientConfig> for ClientConfig
impl Into<CoreClientConfig> for ClientConfig
source§fn into(self) -> CoreClientConfig
fn into(self) -> CoreClientConfig
Converts this type into the (usually inferred) input type.
Auto Trait Implementations§
impl !RefUnwindSafe for ClientConfig
impl Send for ClientConfig
impl Sync for ClientConfig
impl Unpin for ClientConfig
impl !UnwindSafe for ClientConfig
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Upcastable for T
impl<T> Upcastable for T
§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref
§fn upcast_any_box(self: Box<T>) -> Box<dyn Any>
fn upcast_any_box(self: Box<T>) -> Box<dyn Any>
upcast boxed dyn