pub struct SessionBuilder<'a, GL> {
sessions: &'a mut Vec<Box<dyn MainThreadSession>>,
frame_sender: WebXrSender<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: WebXrSender<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: WebXrSender<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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert