Enum brane_cfg::node::NodeSpecificConfig
source · pub enum NodeSpecificConfig {
Central(CentralConfig),
Worker(WorkerConfig),
Proxy(ProxyConfig),
}
Expand description
Defines the services from the various nodes.
Variants§
Central(CentralConfig)
Defines the services for the central node.
Worker(WorkerConfig)
Defines the services for the worker node.
Proxy(ProxyConfig)
Defines the services for the proxy node.
Implementations§
source§impl NodeSpecificConfig
impl NodeSpecificConfig
sourcepub fn is_central(&self) -> bool
pub fn is_central(&self) -> bool
Returns if this NodeSpecificConfig is a NodeSpecificConfig::Central
.
§Returns
True if it is, or false otherwise.
sourcepub fn central(&self) -> &CentralConfig
pub fn central(&self) -> &CentralConfig
Provides immutable access to the central-node specific configuration.
§Returns
A reference to the internal CentralConfig struct.
§Panics
This function panics if we were not NodeSpecificConfig::Central
. If you are looking for a more user-friendly version, check NodeSpecificConfig::try_central()
instead.
sourcepub fn central_mut(&mut self) -> &mut CentralConfig
pub fn central_mut(&mut self) -> &mut CentralConfig
Provides mutable access to the central-node specific configuration.
§Returns
A mutable reference to the internal CentralConfig struct.
§Panics
This function panics if we were not NodeSpecificConfig::Central
. If you are looking for a more user-friendly version, check NodeSpecificConfig::try_central_mut()
instead.
sourcepub fn into_central(self) -> CentralConfig
pub fn into_central(self) -> CentralConfig
sourcepub fn try_central(&self) -> Option<&CentralConfig>
pub fn try_central(&self) -> Option<&CentralConfig>
Provides immutable access to the central-node specific configuration.
§Returns
A reference to the internal CentralConfig struct if we were a NodeSpecificConfig::Central
. Will return None
otherwise.
sourcepub fn try_central_mut(&mut self) -> Option<&mut CentralConfig>
pub fn try_central_mut(&mut self) -> Option<&mut CentralConfig>
Provides mutable access to the central-node specific configuration.
§Returns
A mutable reference to the internal CentralConfig struct if we were a NodeSpecificConfig::Central
. Will return None
otherwise.
sourcepub fn try_into_central(self) -> Option<CentralConfig>
pub fn try_into_central(self) -> Option<CentralConfig>
Returns the internal central-node specific configuration.
§Returns
The internal CentralConfig struct if we were a NodeSpecificConfig::Central
. Will return None
otherwise.
sourcepub fn is_worker(&self) -> bool
pub fn is_worker(&self) -> bool
Returns if this NodeSpecificConfig is a NodeSpecificConfig::Worker
.
§Returns
True if it is, or false otherwise.
sourcepub fn worker(&self) -> &WorkerConfig
pub fn worker(&self) -> &WorkerConfig
sourcepub fn worker_mut(&mut self) -> &mut WorkerConfig
pub fn worker_mut(&mut self) -> &mut WorkerConfig
Provides mutable access to the worker-node specific configuration.
§Returns
A mutable reference to the internal WorkerConfig struct.
§Panics
This function panics if we were not NodeSpecificConfig::Worker
. If you are looking for a more user-friendly version, check NodeSpecificConfig::try_worker_mut()
instead.
sourcepub fn into_worker(self) -> WorkerConfig
pub fn into_worker(self) -> WorkerConfig
sourcepub fn try_worker(&self) -> Option<&WorkerConfig>
pub fn try_worker(&self) -> Option<&WorkerConfig>
Provides immutable access to the worker-node specific configuration.
§Returns
A reference to the internal WorkerConfig struct if we were a NodeSpecificConfig::Worker
. Will return None
otherwise.
sourcepub fn try_worker_mut(&mut self) -> Option<&mut WorkerConfig>
pub fn try_worker_mut(&mut self) -> Option<&mut WorkerConfig>
Provides mutable access to the worker-node specific configuration.
§Returns
A mutable reference to the internal WorkerConfig struct if we were a NodeSpecificConfig::Worker
. Will return None
otherwise.
sourcepub fn try_into_worker(self) -> Option<WorkerConfig>
pub fn try_into_worker(self) -> Option<WorkerConfig>
Returns the internal worker-node specific configuration.
§Returns
The internal WorkerConfig struct if we were a NodeSpecificConfig::Worker
. Will return None
otherwise.
sourcepub fn is_proxy(&self) -> bool
pub fn is_proxy(&self) -> bool
Returns if this NodeSpecificConfig is a NodeSpecificConfig::Proxy
.
§Returns
True if it is, or false otherwise.
sourcepub fn proxy(&self) -> &ProxyConfig
pub fn proxy(&self) -> &ProxyConfig
sourcepub fn proxy_mut(&mut self) -> &mut ProxyConfig
pub fn proxy_mut(&mut self) -> &mut ProxyConfig
Provides mutable access to the proxy-node specific configuration.
§Returns
A mutable reference to the internal ProxyConfig struct.
§Panics
This function panics if we were not NodeSpecificConfig::Proxy
. If you are looking for a more user-friendly version, check NodeSpecificConfig::try_proxy_mut()
instead.
sourcepub fn into_proxy(self) -> ProxyConfig
pub fn into_proxy(self) -> ProxyConfig
sourcepub fn try_proxy(&self) -> Option<&ProxyConfig>
pub fn try_proxy(&self) -> Option<&ProxyConfig>
Provides immutable access to the proxy-node specific configuration.
§Returns
A reference to the internal ProxyConfig struct if we were a NodeSpecificConfig::Proxy
. Will return None
otherwise.
sourcepub fn try_proxy_mut(&mut self) -> Option<&mut ProxyConfig>
pub fn try_proxy_mut(&mut self) -> Option<&mut ProxyConfig>
Provides mutable access to the proxy-node specific configuration.
§Returns
A mutable reference to the internal ProxyConfig struct if we were a NodeSpecificConfig::Proxy
. Will return None
otherwise.
sourcepub fn try_into_proxy(self) -> Option<ProxyConfig>
pub fn try_into_proxy(self) -> Option<ProxyConfig>
Returns the internal proxy-node specific configuration.
§Returns
The internal ProxyConfig struct if we were a NodeSpecificConfig::Proxy
. Will return None
otherwise.
Trait Implementations§
source§impl Clone for NodeSpecificConfig
impl Clone for NodeSpecificConfig
source§fn clone(&self) -> NodeSpecificConfig
fn clone(&self) -> NodeSpecificConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for NodeSpecificConfig
impl Debug for NodeSpecificConfig
source§impl<'de> Deserialize<'de> for NodeSpecificConfig
impl<'de> Deserialize<'de> for NodeSpecificConfig
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl EnumDebug for NodeSpecificConfig
impl EnumDebug for NodeSpecificConfig
source§fn type_name() -> &'static str
fn type_name() -> &'static str
source§fn variant_names() -> &'static [&'static str]
fn variant_names() -> &'static [&'static str]
source§fn variant_name(&self) -> &'static str
fn variant_name(&self) -> &'static str
source§fn variant(&self) -> EnumDebugFormatter<'_, Self>
fn variant(&self) -> EnumDebugFormatter<'_, Self>
Auto Trait Implementations§
impl Freeze for NodeSpecificConfig
impl RefUnwindSafe for NodeSpecificConfig
impl Send for NodeSpecificConfig
impl Sync for NodeSpecificConfig
impl Unpin for NodeSpecificConfig
impl UnwindSafe for NodeSpecificConfig
Blanket Implementations§
source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request