pub struct CompositionBuilder { /* private fields */ }Expand description
Builds and validates one composition without starting traffic.
Implementations§
Source§impl CompositionBuilder
impl CompositionBuilder
Sourcepub fn add_box<T, F>(
&mut self,
descriptor: ImplementationDescriptor,
factory: F,
) -> &mut Self
pub fn add_box<T, F>( &mut self, descriptor: ImplementationDescriptor, factory: F, ) -> &mut Self
Registers a box and immediately constructs its target from lazy imports.
Sourcepub fn register<T, F>(
&mut self,
descriptor: ImplementationDescriptor,
factory: F,
) -> RegisteredBox
pub fn register<T, F>( &mut self, descriptor: ImplementationDescriptor, factory: F, ) -> RegisteredBox
Registers a box and returns a token for concise typed wiring.
Sourcepub fn connect(
&mut self,
consumer: &RegisteredBox,
provider: &RegisteredBox,
) -> &mut Self
pub fn connect( &mut self, consumer: &RegisteredBox, provider: &RegisteredBox, ) -> &mut Self
Connects the consumer import slot named by the provider box to that local provider.
Sourcepub fn expose_all<B>(
&mut self,
provider: &RegisteredBox,
transport: Arc<B>,
level: ExposureLevel,
) -> &mut Selfwhere
B: TransportBinding,
pub fn expose_all<B>(
&mut self,
provider: &RegisteredBox,
transport: Arc<B>,
level: ExposureLevel,
) -> &mut Selfwhere
B: TransportBinding,
Exposes every capability of one registered box through a transport allocation.
Sourcepub fn handle<H>(&mut self, provider: &RegisteredBox) -> Hwhere
H: BoxHandle,
pub fn handle<H>(&mut self, provider: &RegisteredBox) -> Hwhere
H: BoxHandle,
Creates a generated typed handle and exposes its box in-process.
Sourcepub fn resolve_import(
&mut self,
consumer: BoxId,
slot: BoxId,
target: ImportTarget,
) -> &mut Self
pub fn resolve_import( &mut self, consumer: BoxId, slot: BoxId, target: ImportTarget, ) -> &mut Self
Records a target selection for one consumer import slot.
Sourcepub fn expose<B>(
&mut self,
provider: BoxId,
capability: CapabilityId,
transport: Arc<B>,
level: ExposureLevel,
) -> &mut Selfwhere
B: TransportBinding,
pub fn expose<B>(
&mut self,
provider: BoxId,
capability: CapabilityId,
transport: Arc<B>,
level: ExposureLevel,
) -> &mut Selfwhere
B: TransportBinding,
Exposes one exact provider capability through a configured transport allocation.
Sourcepub fn validate(&self) -> Result<(), AssemblyErrors>
pub fn validate(&self) -> Result<(), AssemblyErrors>
Reports every assembly failure without sealing imports or starting traffic.
Sourcepub fn start(self) -> Result<Composition, AssemblyErrors>
pub fn start(self) -> Result<Composition, AssemblyErrors>
Validates, starts every transport closed, then atomically commits traffic.
Trait Implementations§
Source§impl Default for CompositionBuilder
impl Default for CompositionBuilder
Source§fn default() -> CompositionBuilder
fn default() -> CompositionBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for CompositionBuilder
impl !UnwindSafe for CompositionBuilder
impl Freeze for CompositionBuilder
impl Send for CompositionBuilder
impl Sync for CompositionBuilder
impl Unpin for CompositionBuilder
impl UnsafeUnpin for CompositionBuilder
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
Mutably borrows from an owned value. Read more