pub struct TopologyBlueprint { /* private fields */ }
Expand description
A topology blueprint represents a directed graph of components.
Implementations§
Source§impl TopologyBlueprint
impl TopologyBlueprint
Sourcepub fn new(name: &str, component_registry: &ComponentRegistry) -> Self
pub fn new(name: &str, component_registry: &ComponentRegistry) -> Self
Creates an empty TopologyBlueprint
with the given name.
Sourcepub fn with_interconnect_capacity(
&mut self,
capacity: NonZeroUsize,
) -> &mut Self
pub fn with_interconnect_capacity( &mut self, capacity: NonZeroUsize, ) -> &mut Self
Sets the capacity of interconnects in the topology.
Interconnects are used to connect components to one another. Once their capacity is reached, no more items can be sent through until in-flight items are processed. This will apply backpressure to the upstream components. Raising or lowering the capacity allows trading off throughput at the expense of memory usage.
Defaults to 128.
Sourcepub fn add_source<I, B>(
&mut self,
component_id: I,
builder: B,
) -> Result<&mut Self, GenericError>
pub fn add_source<I, B>( &mut self, component_id: I, builder: B, ) -> Result<&mut Self, GenericError>
Adds a source component to the blueprint.
§Errors
If the component ID is invalid or the component cannot be added to the graph, an error is returned.
Sourcepub fn add_transform<I, B>(
&mut self,
component_id: I,
builder: B,
) -> Result<&mut Self, GenericError>
pub fn add_transform<I, B>( &mut self, component_id: I, builder: B, ) -> Result<&mut Self, GenericError>
Adds a transform component to the blueprint.
§Errors
If the component ID is invalid or the component cannot be added to the graph, an error is returned.
Sourcepub fn add_destination<I, B>(
&mut self,
component_id: I,
builder: B,
) -> Result<&mut Self, GenericError>
pub fn add_destination<I, B>( &mut self, component_id: I, builder: B, ) -> Result<&mut Self, GenericError>
Adds a destination component to the blueprint.
§Errors
If the component ID is invalid or the component cannot be added to the graph, an error is returned.
Sourcepub fn add_encoder<I, B>(
&mut self,
component_id: I,
builder: B,
) -> Result<&mut Self, GenericError>
pub fn add_encoder<I, B>( &mut self, component_id: I, builder: B, ) -> Result<&mut Self, GenericError>
Adds an encoder component to the blueprint.
§Errors
If the component ID is invalid or the component cannot be added to the graph, an error is returned.
Sourcepub fn add_forwarder<I, B>(
&mut self,
component_id: I,
builder: B,
) -> Result<&mut Self, GenericError>
pub fn add_forwarder<I, B>( &mut self, component_id: I, builder: B, ) -> Result<&mut Self, GenericError>
Adds a forwarder component to the blueprint.
§Errors
If the component ID is invalid or the component cannot be added to the graph, an error is returned.
Sourcepub fn connect_component<DI, SI, I>(
&mut self,
destination_component_id: DI,
source_output_component_ids: SI,
) -> Result<&mut Self, GenericError>
pub fn connect_component<DI, SI, I>( &mut self, destination_component_id: DI, source_output_component_ids: SI, ) -> Result<&mut Self, GenericError>
Connects one or more source component outputs to a destination component.
§Errors
If the destination component ID, or any of the source component IDs, are invalid or do not exist, or if the data types between one of the source/destination component pairs is incompatible, an error is returned.
Sourcepub async fn build(self) -> Result<BuiltTopology, GenericError>
pub async fn build(self) -> Result<BuiltTopology, GenericError>
Auto Trait Implementations§
impl Freeze for TopologyBlueprint
impl !RefUnwindSafe for TopologyBlueprint
impl Send for TopologyBlueprint
impl !Sync for TopologyBlueprint
impl Unpin for TopologyBlueprint
impl !UnwindSafe for TopologyBlueprint
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> 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
Source§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Track for T
impl<T> Track for T
§fn track_allocations(self, token: AllocationGroupToken) -> Tracked<Self>
fn track_allocations(self, token: AllocationGroupToken) -> Tracked<Self>
Tracked
wrapper. Read more§fn in_current_allocation_group(self) -> Tracked<Self>
fn in_current_allocation_group(self) -> Tracked<Self>
Tracked
wrapper. Read more