pub struct CompositionContext<'a> {
stack: Vec<(TypeId, String)>,
registry: &'static Registry,
composition: Option<&'a Composition>,
}Fields§
§stack: Vec<(TypeId, String)>§registry: &'static Registry§composition: Option<&'a Composition>Implementations§
Source§impl CompositionContext<'_>
impl CompositionContext<'_>
Sourcepub fn blank(registry: &'static Registry) -> Self
pub fn blank(registry: &'static Registry) -> Self
Get a composition context for one-off store creation.
Sourcepub async fn resolve<T: ?Sized + Send + Sync + 'static>(
&self,
s: &str,
) -> Result<Arc<T>, CompositionError>
pub async fn resolve<T: ?Sized + Send + Sync + 'static>( &self, s: &str, ) -> Result<Arc<T>, CompositionError>
Resolves an instance ref (instance name prefixed with “&”) or an anonymous store URL to an instantiated service. The latter is only allowed if xp-composition-url-refs is enabled.
async fn build_anonymous<T: ?Sized + Send + Sync + 'static>( &self, url_str: &str, ) -> Result<Arc<T>, Box<dyn Error + Send + Sync>>
Available on crate feature
xp-composition-url-refs only.fn build_internal<T: ?Sized + Send + Sync + 'static>( &self, instance_name: String, ) -> BoxFuture<'_, Result<Arc<T>, CompositionError>>
Auto Trait Implementations§
impl<'a> Freeze for CompositionContext<'a>
impl<'a> !RefUnwindSafe for CompositionContext<'a>
impl<'a> Send for CompositionContext<'a>
impl<'a> Sync for CompositionContext<'a>
impl<'a> Unpin for CompositionContext<'a>
impl<'a> !UnwindSafe for CompositionContext<'a>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§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> 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::RequestSource§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