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