Struct tvix_store::composition::Composition
source · pub struct Composition {
registry: &'static Registry,
stores: Mutex<HashMap<(TypeId, String), Box<dyn Any + Send + Sync>>>,
}
Fields§
§registry: &'static Registry
§stores: Mutex<HashMap<(TypeId, String), Box<dyn Any + Send + Sync>>>
Implementations§
source§impl Composition
impl Composition
sourcepub fn new(registry: &'static Registry) -> Composition
pub fn new(registry: &'static Registry) -> Composition
The given registry will be used for creation of anonymous stores during composition
pub fn extend_with_configs<T>( &mut self, configs: HashMap<String, DeserializeWithRegistry<Box<dyn ServiceBuilder<Output = T>>>>, )
sourcepub async fn build<T>(
&self,
entrypoint: &str,
) -> Result<Arc<T>, CompositionError>
pub async fn build<T>( &self, entrypoint: &str, ) -> Result<Arc<T>, CompositionError>
Looks up the entrypoint name in the composition and returns an instantiated service.
pub fn context(&self) -> CompositionContext<'_>
Trait Implementations§
source§impl<T> Extend<(String, DeserializeWithRegistry<Box<dyn ServiceBuilder<Output = T>>>)> for Composition
impl<T> Extend<(String, DeserializeWithRegistry<Box<dyn ServiceBuilder<Output = T>>>)> for Composition
source§fn extend<I>(&mut self, configs: I)where
I: IntoIterator<Item = (String, DeserializeWithRegistry<Box<dyn ServiceBuilder<Output = T>>>)>,
fn extend<I>(&mut self, configs: I)where
I: IntoIterator<Item = (String, DeserializeWithRegistry<Box<dyn ServiceBuilder<Output = T>>>)>,
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Auto Trait Implementations§
impl !Freeze for Composition
impl !RefUnwindSafe for Composition
impl Send for Composition
impl Sync for Composition
impl Unpin for Composition
impl !UnwindSafe for Composition
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
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§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>
Wrap the input message
T
in a tonic::Request