pub struct Controller<C: Controllable> { /* private fields */ }Expand description
Holds information about the component that allows the controller to interact with and control the component.
Implementations§
Source§impl<C: Controllable + 'static> Controller<C>
impl<C: Controllable + 'static> Controller<C>
Sourcepub fn new(
controllable: C,
requests: ComponentControllerRequestStream,
control: ComponentControllerControlHandle,
) -> Controller<C>
pub fn new( controllable: C, requests: ComponentControllerRequestStream, control: ComponentControllerControlHandle, ) -> Controller<C>
Creates new instance
Sourcepub async fn serve(self, exit_fut: impl Future<Output = StopInfo> + Unpin)
pub async fn serve(self, exit_fut: impl Future<Output = StopInfo> + Unpin)
Serve the request stream held by this Controller. exit_fut should
complete if the component exits and should return a value which is
either 0 (ZX_OK) or one of the fuchsia.component/Error constants
defined as valid in the fuchsia.component.runner/ComponentController
documentation. This function will return after exit_fut completes
or the request stream closes. In either case the request stream is
closed once this function returns since the stream itself, which owns
the channel, is dropped.
Auto Trait Implementations§
impl<C> Freeze for Controller<C>where
C: Freeze,
impl<C> !RefUnwindSafe for Controller<C>
impl<C> Send for Controller<C>where
C: Send,
impl<C> Sync for Controller<C>where
C: Sync,
impl<C> Unpin for Controller<C>where
C: Unpin,
impl<C> !UnwindSafe for Controller<C>
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,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
Converts the given service transport handle of type
T to [Self]§impl<T> IntoAny for T
impl<T> IntoAny for T
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