pub struct HostBuilder { /* private fields */ }
Expand description
A builder pattern implementation for creating a custom-configured host runtime
Implementations§
Source§impl HostBuilder
impl HostBuilder
Sourcepub fn new() -> HostBuilder
pub fn new() -> HostBuilder
Creates a new host builder. This builder will initialize itself with some defaults
obtained from the environment. The labels list will pre-populate with the hostcore.*
labels, the namespace will be gleaned from the LATTICE_NAMESPACE
environment variable
(if lattice mode is enabled), and the default authorizer will be set.
Sourcepub fn with_lattice_namespace(self, ns: &str) -> HostBuilder
pub fn with_lattice_namespace(self, ns: &str) -> HostBuilder
Sets the lattice namespace for this host. A lattice namespace is a unit of multi-tenant isolation on a network. To reduce the risk of conflicts or subscription failures, the lattice namespace should not include any non-alphanumeric characters.
Sets a custom authorizer to be used for authorizing actors, capability providers, and invocation requests. Note that the authorizer cannot be used to implement less strict measures than the default authorizer, it can only be used to implement more strict rules
Sourcepub fn with_label(self, key: &str, value: &str) -> HostBuilder
pub fn with_label(self, key: &str, value: &str) -> HostBuilder
Adds an arbitrary label->value pair of metadata to the host. Cannot override
reserved labels such as those that begin with hostcore.
Calling this twice
on the same label will have no effect after the first call.
Auto Trait Implementations§
impl Freeze for HostBuilder
impl !RefUnwindSafe for HostBuilder
impl Send for HostBuilder
impl Sync for HostBuilder
impl Unpin for HostBuilder
impl !UnwindSafe for HostBuilder
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> 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> 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