pub struct ComponentContext { /* private fields */ }Expand description
A component context.
Holds the identifiers (absolute and relative) for a component, as well as its type.
Implementations§
Source§impl ComponentContext
impl ComponentContext
Sourcepub fn new(
topology_root: &SubsystemIdentifier,
component_id: ComponentId,
component_type: ComponentType,
) -> Self
pub fn new( topology_root: &SubsystemIdentifier, component_id: ComponentId, component_type: ComponentType, ) -> Self
Creates a new ComponentContext rooted at the given topology, with the given identifier and type.
Sourcepub fn source(
topology_root: &SubsystemIdentifier,
component_id: ComponentId,
) -> Self
pub fn source( topology_root: &SubsystemIdentifier, component_id: ComponentId, ) -> Self
Creates a new ComponentContext for a source component with the given identifier, within the named topology.
Sourcepub fn relay(
topology_root: &SubsystemIdentifier,
component_id: ComponentId,
) -> Self
pub fn relay( topology_root: &SubsystemIdentifier, component_id: ComponentId, ) -> Self
Creates a new ComponentContext for a relay component with the given identifier, within the named topology.
Sourcepub fn decoder(
topology_root: &SubsystemIdentifier,
component_id: ComponentId,
) -> Self
pub fn decoder( topology_root: &SubsystemIdentifier, component_id: ComponentId, ) -> Self
Creates a new ComponentContext for a decoder component with the given identifier, within the named topology.
Sourcepub fn transform(
topology_root: &SubsystemIdentifier,
component_id: ComponentId,
) -> Self
pub fn transform( topology_root: &SubsystemIdentifier, component_id: ComponentId, ) -> Self
Creates a new ComponentContext for a transform component with the given identifier, within the named topology.
Sourcepub fn encoder(
topology_root: &SubsystemIdentifier,
component_id: ComponentId,
) -> Self
pub fn encoder( topology_root: &SubsystemIdentifier, component_id: ComponentId, ) -> Self
Creates a new ComponentContext for an encoder component with the given identifier, within the named topology.
Sourcepub fn forwarder(
topology_root: &SubsystemIdentifier,
component_id: ComponentId,
) -> Self
pub fn forwarder( topology_root: &SubsystemIdentifier, component_id: ComponentId, ) -> Self
Creates a new ComponentContext for a forwarder component with the given identifier, within the named topology.
Sourcepub fn destination(
topology_root: &SubsystemIdentifier,
component_id: ComponentId,
) -> Self
pub fn destination( topology_root: &SubsystemIdentifier, component_id: ComponentId, ) -> Self
Creates a new ComponentContext for a destination component with the given identifier, within the named topology.
Sourcepub fn component_id(&self) -> &ComponentId
pub fn component_id(&self) -> &ComponentId
Returns the component identifier.
This is the relative identifier of the component, unique within its topology but not guaranteed to be globally
unique. See ComponentContext::identity for the fully qualified identity.
Sourcepub fn component_type(&self) -> ComponentType
pub fn component_type(&self) -> ComponentType
Returns the component type.
Sourcepub fn identity(&self) -> SubsystemIdentifier
pub fn identity(&self) -> SubsystemIdentifier
Returns the fully qualified identity of this component.
The returned identifier uniquely identifies the component within the process, inclusive of the topology to which it belongs.
Trait Implementations§
Source§impl Clone for ComponentContext
impl Clone for ComponentContext
Source§fn clone(&self) -> ComponentContext
fn clone(&self) -> ComponentContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ComponentContext
impl Debug for ComponentContext
Source§impl Display for ComponentContext
impl Display for ComponentContext
Source§impl Hash for ComponentContext
impl Hash for ComponentContext
Source§impl PartialEq for ComponentContext
impl PartialEq for ComponentContext
impl Eq for ComponentContext
impl StructuralPartialEq for ComponentContext
Auto Trait Implementations§
impl Freeze for ComponentContext
impl RefUnwindSafe for ComponentContext
impl Send for ComponentContext
impl Sync for ComponentContext
impl Unpin for ComponentContext
impl UnwindSafe for ComponentContext
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Track for T
impl<T> Track for T
§fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
Tracked wrapper. Read more§fn in_current_resource_group(self) -> Tracked<Self>
fn in_current_resource_group(self) -> Tracked<Self>
Tracked wrapper. Read more