Enum brane_cfg::node::PrivateOrExternalService
source · pub enum PrivateOrExternalService {
Private(PrivateService),
External(ExternalService),
}
Expand description
Defines an abstraction over either a private service, or an external service.
Variants§
Implementations§
source§impl PrivateOrExternalService
impl PrivateOrExternalService
sourcepub fn is_private(&self) -> bool
pub fn is_private(&self) -> bool
Returns whether this is a private service or not.
§Returns
True if it is, false if it is an external service.
sourcepub fn private(&self) -> &PrivateService
pub fn private(&self) -> &PrivateService
sourcepub fn private_mut(&mut self) -> &mut PrivateService
pub fn private_mut(&mut self) -> &mut PrivateService
sourcepub fn into_private(self) -> PrivateService
pub fn into_private(self) -> PrivateService
sourcepub fn try_private(&self) -> Option<&PrivateService>
pub fn try_private(&self) -> Option<&PrivateService>
Provides access to the internal PrivateService
object, assuming this is one.
§Returns
A reference to the internal PrivateService
object if this is a PrivateOrExternalService::Private
, or else None
.
sourcepub fn try_private_mut(&mut self) -> Option<&mut PrivateService>
pub fn try_private_mut(&mut self) -> Option<&mut PrivateService>
Provides mutable access to the internal PrivateService
object, assuming this is one.
§Returns
A mutable reference to the internal PrivateService
object if this is a PrivateOrExternalService::Private
, or else None
.
sourcepub fn try_into_private(self) -> Option<PrivateService>
pub fn try_into_private(self) -> Option<PrivateService>
Returns the internal PrivateService
object, assuming this is one.
§Returns
The internal PrivateService
object if this is a PrivateOrExternalService::Private
, or else None
. This consumes self
.
sourcepub fn is_external(&self) -> bool
pub fn is_external(&self) -> bool
Returns whether this is an external service or not.
§Returns
True if it is, false if it is a private service.
sourcepub fn external(&self) -> &ExternalService
pub fn external(&self) -> &ExternalService
sourcepub fn external_mut(&mut self) -> &mut ExternalService
pub fn external_mut(&mut self) -> &mut ExternalService
sourcepub fn into_external(self) -> ExternalService
pub fn into_external(self) -> ExternalService
sourcepub fn try_external(&self) -> Option<&ExternalService>
pub fn try_external(&self) -> Option<&ExternalService>
Provides access to the internal ExternalService
object, assuming this is one.
§Returns
A reference to the internal ExternalService
object if this is a PrivateOrExternalService::External
, or else None
.
sourcepub fn try_external_mut(&mut self) -> Option<&mut ExternalService>
pub fn try_external_mut(&mut self) -> Option<&mut ExternalService>
Provides mutable access to the internal ExternalService
object, assuming this is one.
§Returns
A mutable reference to the internal ExternalService
object if this is a PrivateOrExternalService::External
, or else None
.
sourcepub fn try_into_external(self) -> Option<ExternalService>
pub fn try_into_external(self) -> Option<ExternalService>
Returns the internal ExternalService
object, assuming this is one.
§Returns
The internal ExternalService
object if this is a PrivateOrExternalService::External
, or else None
. This consumes self
.
sourcepub fn address(&self) -> &Address
pub fn address(&self) -> &Address
Provides access to the internal (private) address that services can connect to.
§Returns
A reference to the internal Address
-object.
sourcepub fn address_mut(&mut self) -> &mut Address
pub fn address_mut(&mut self) -> &mut Address
Provides mutable access to the internal (private) address that services can connect to.
§Returns
A mutable reference to the internal Address
-object.
sourcepub fn into_address(self) -> Address
pub fn into_address(self) -> Address
Returns the internal (private) address that services can connect to.
§Returns
The internal Address
-object. This consumes self
.
Trait Implementations§
source§impl Clone for PrivateOrExternalService
impl Clone for PrivateOrExternalService
source§fn clone(&self) -> PrivateOrExternalService
fn clone(&self) -> PrivateOrExternalService
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PrivateOrExternalService
impl Debug for PrivateOrExternalService
source§impl<'de> Deserialize<'de> for PrivateOrExternalService
impl<'de> Deserialize<'de> for PrivateOrExternalService
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 PrivateOrExternalService
impl EnumDebug for PrivateOrExternalService
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 PrivateOrExternalService
impl RefUnwindSafe for PrivateOrExternalService
impl Send for PrivateOrExternalService
impl Sync for PrivateOrExternalService
impl Unpin for PrivateOrExternalService
impl UnwindSafe for PrivateOrExternalService
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