pub struct ServiceContext { /* private fields */ }
Expand description
A wrapper around service operations, allowing redirection to a nested environment.
Implementations§
Source§impl ServiceContext
impl ServiceContext
pub fn new(generate_service: Option<GenerateService>) -> Self
pub async fn connect<P: DiscoverableProtocolMarker, Publisher, F>( &self, gen_publisher_fn: impl Fn() -> F, ) -> Result<ExternalServiceProxy<P::Proxy, Publisher>, Error>
pub async fn connect_with_publisher<P: DiscoverableProtocolMarker, Publisher>(
&self,
publisher: Publisher,
) -> Result<ExternalServiceProxy<P::Proxy, Publisher>, Error>where
Publisher: EventPublisher + Clone,
Sourcepub async fn connect_device_path<P: DiscoverableProtocolMarker, Publisher>(
&self,
glob_pattern: &str,
publisher: Publisher,
) -> Result<ExternalServiceProxy<P::Proxy, Publisher>, Error>where
Publisher: EventPublisher + Clone,
pub async fn connect_device_path<P: DiscoverableProtocolMarker, Publisher>(
&self,
glob_pattern: &str,
publisher: Publisher,
) -> Result<ExternalServiceProxy<P::Proxy, Publisher>, Error>where
Publisher: EventPublisher + Clone,
Connect to a service by discovering a hardware device at the given glob-style pattern.
The first discovered path will be used to connected.
If a GenerateService was specified at creation, the name of the service marker will be used to generate a service and the path will be ignored.
Auto Trait Implementations§
impl Freeze for ServiceContext
impl !RefUnwindSafe for ServiceContext
impl !Send for ServiceContext
impl !Sync for ServiceContext
impl Unpin for ServiceContext
impl !UnwindSafe for ServiceContext
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, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
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 more