pub enum LifecycleRequest {
Start {
payload: LifecycleStartRequest,
responder: LifecycleStartResponder,
},
Stop {
responder: LifecycleStopResponder,
},
Restart {
responder: LifecycleRestartResponder,
},
_UnknownMethod {
ordinal: u64,
control_handle: LifecycleControlHandle,
method_type: MethodType,
},
}
Expand description
A protocol used to control the session’s lifecycle.
Variants§
Start
Starts the session.
Returns after the session component has been created and started.
- error
LifecycleError.NOT_FOUND
ifsession_url
has not been provided and there is no configured default session URL. - error
LifecycleError.ALREADY_STARTED
if a session has already been started. - error
LifecycleError.RESOLVE_COMPONENT_FAILED
ifsession_url
could not be resolved to a component. - error
LifecycleError.DESTROY_COMPONENT_FAILED
if an existing session component could not be destroyed. The existing session remains running at this point. - error
LifecycleError.CREATE_COMPONENT_FAILED
if the session component could not be started. No session will be running at this point.
Stop
Stops the session.
Returns after the session component has been destroyed.
- error
LifecycleError.NOT_FOUND
if the session has not been started. - error
LifecycleError.DESTROY_COMPONENT_FAILED
if the session component could not be destroyed. The previous session will continue to exist at this point and the component may be running.
Fields
§
responder: LifecycleStopResponder
Restart
Restarts the session.
This stops the existing session and starts a new session with the same session URL as the previous one.
Returns once the new session component has been created and started.
- error
LifecycleError.NOT_FOUND
if there is no existing session. - error
LifecycleError.RESOLVE_COMPONENT_FAILED
if the session URL could not be resolved to a component. - error
LifecycleError.DESTROY_COMPONENT_FAILED
if the session component could not be destroyed. The previous session will continue to exist at this point and the component may be running. - error
LifecycleError.CREATE_COMPONENT_FAILED
if the session component could not be started. No session will be running at this point.
Fields
§
responder: LifecycleRestartResponder
_UnknownMethod
An interaction was received which does not match any known method.
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§
control_handle: LifecycleControlHandle
§
method_type: MethodType
Implementations§
Source§impl LifecycleRequest
impl LifecycleRequest
pub fn into_start( self, ) -> Option<(LifecycleStartRequest, LifecycleStartResponder)>
pub fn into_stop(self) -> Option<LifecycleStopResponder>
pub fn into_restart(self) -> Option<LifecycleRestartResponder>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LifecycleRequest
impl !RefUnwindSafe for LifecycleRequest
impl Send for LifecycleRequest
impl Sync for LifecycleRequest
impl Unpin for LifecycleRequest
impl !UnwindSafe for LifecycleRequest
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