pub struct SessionManager { /* private fields */ }
Expand description
Manages the session lifecycle and provides services to control the session.
Implementations§
Source§impl SessionManager
impl SessionManager
Sourcepub fn new(
realm: RealmProxy,
inspector: &Inspector,
default_session_url: Option<String>,
suspend_enabled: bool,
) -> Self
pub fn new( realm: RealmProxy, inspector: &Inspector, default_session_url: Option<String>, suspend_enabled: bool, ) -> Self
Constructs a new SessionManager
.
§Parameters
realm
: The realm in which session components will be created.
Sourcepub async fn start_default_session(&mut self) -> Result<(), Error>
pub async fn start_default_session(&mut self) -> Result<(), Error>
Starts the session with the default session component URL, if any.
§Errors
Returns an error if the is no default session URL or the session could not be launched.
Sourcepub async fn serve(
&mut self,
fs: &mut ServiceFs<ServiceObjLocal<'_, IncomingRequest>>,
) -> Result<(), Error>
pub async fn serve( &mut self, fs: &mut ServiceFs<ServiceObjLocal<'_, IncomingRequest>>, ) -> Result<(), Error>
Starts serving IncomingRequest
from svc
.
This will return once the ServiceFs
stops serving requests.
§Errors
Returns an error if there is an issue serving the svc
directory handle.
Sourcepub async fn handle_launcher_request_stream(
&mut self,
request_stream: LauncherRequestStream,
) -> Result<(), Error>
pub async fn handle_launcher_request_stream( &mut self, request_stream: LauncherRequestStream, ) -> Result<(), Error>
Sourcepub async fn handle_restarter_request_stream(
&mut self,
request_stream: RestarterRequestStream,
) -> Result<(), Error>
pub async fn handle_restarter_request_stream( &mut self, request_stream: RestarterRequestStream, ) -> Result<(), Error>
Sourcepub async fn handle_lifecycle_request_stream(
&mut self,
request_stream: LifecycleRequestStream,
) -> Result<(), Error>
pub async fn handle_lifecycle_request_stream( &mut self, request_stream: LifecycleRequestStream, ) -> Result<(), Error>
pub async fn handle_handoff_request_stream( &mut self, request_stream: HandoffRequestStream, ) -> Result<(), Error>
Trait Implementations§
Source§impl Clone for SessionManager
impl Clone for SessionManager
Source§fn clone(&self) -> SessionManager
fn clone(&self) -> SessionManager
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for SessionManager
impl !RefUnwindSafe for SessionManager
impl Send for SessionManager
impl Sync for SessionManager
impl Unpin for SessionManager
impl !UnwindSafe for SessionManager
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)