Struct webxr_api::SessionBuilder
source · pub struct SessionBuilder<'a, GL> {
sessions: &'a mut Vec<Box<dyn MainThreadSession>>,
frame_sender: Sender<Frame>,
layer_grand_manager: LayerGrandManager<GL>,
id: SessionId,
}
Expand description
A type for building XR sessions
Fields§
§sessions: &'a mut Vec<Box<dyn MainThreadSession>>
§frame_sender: Sender<Frame>
§layer_grand_manager: LayerGrandManager<GL>
§id: SessionId
Implementations§
source§impl<'a, GL: 'static> SessionBuilder<'a, GL>
impl<'a, GL: 'static> SessionBuilder<'a, GL>
pub fn id(&self) -> SessionId
pub(crate) fn new( sessions: &'a mut Vec<Box<dyn MainThreadSession>>, frame_sender: Sender<Frame>, layer_grand_manager: LayerGrandManager<GL>, id: SessionId, ) -> Self
sourcepub fn spawn<Device, Factory>(self, factory: Factory) -> Result<Session, Error>
pub fn spawn<Device, Factory>(self, factory: Factory) -> Result<Session, Error>
For devices which are happy to hand over thread management to webxr.
sourcepub fn run_on_main_thread<Device, Factory>(
self,
factory: Factory,
) -> Result<Session, Error>
pub fn run_on_main_thread<Device, Factory>( self, factory: Factory, ) -> Result<Session, Error>
For devices that need to run on the main thread.
Auto Trait Implementations§
impl<'a, GL> Freeze for SessionBuilder<'a, GL>
impl<'a, GL> !RefUnwindSafe for SessionBuilder<'a, GL>
impl<'a, GL> !Send for SessionBuilder<'a, GL>
impl<'a, GL> !Sync for SessionBuilder<'a, GL>
impl<'a, GL> Unpin for SessionBuilder<'a, GL>
impl<'a, GL> !UnwindSafe for SessionBuilder<'a, GL>
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