#[repr(C)]pub struct XRSession {Show 19 fields
eventtarget: EventTarget,
blend_mode: XREnvironmentBlendMode,
mode: XRSessionMode,
visibility_state: Cell<XRVisibilityState>,
viewer_space: MutNullableDom<XRSpace>,
session: DomRefCell<Session>,
frame_requested: Cell<bool>,
pending_render_state: MutNullableDom<XRRenderState>,
active_render_state: MutDom<XRRenderState>,
inline_projection_matrix: DomRefCell<Transform3D<f32, Viewer, Display>>,
next_raf_id: Cell<i32>,
raf_callback_list: DomRefCell<Vec<(i32, Option<Rc<XRFrameRequestCallback>>)>>,
current_raf_callback_list: DomRefCell<Vec<(i32, Option<Rc<XRFrameRequestCallback>>)>>,
input_sources: Dom<XRInputSourceArray>,
end_promises: DomRefCell<Vec<Rc<Promise>>>,
ended: Cell<bool>,
next_hit_test_id: Cell<HitTestId>,
pending_hit_test_promises: DomRefCell<HashMapTracedValues<HitTestId, Rc<Promise>>>,
outside_raf: Cell<bool>,
}
Fields§
§eventtarget: EventTarget
§blend_mode: XREnvironmentBlendMode
§mode: XRSessionMode
§visibility_state: Cell<XRVisibilityState>
§viewer_space: MutNullableDom<XRSpace>
§session: DomRefCell<Session>
§frame_requested: Cell<bool>
§pending_render_state: MutNullableDom<XRRenderState>
§active_render_state: MutDom<XRRenderState>
§inline_projection_matrix: DomRefCell<Transform3D<f32, Viewer, Display>>
Cached projection matrix for inline sessions
next_raf_id: Cell<i32>
§raf_callback_list: DomRefCell<Vec<(i32, Option<Rc<XRFrameRequestCallback>>)>>
§current_raf_callback_list: DomRefCell<Vec<(i32, Option<Rc<XRFrameRequestCallback>>)>>
§input_sources: Dom<XRInputSourceArray>
§end_promises: DomRefCell<Vec<Rc<Promise>>>
§ended: Cell<bool>
§next_hit_test_id: Cell<HitTestId>
§pending_hit_test_promises: DomRefCell<HashMapTracedValues<HitTestId, Rc<Promise>>>
§outside_raf: Cell<bool>
Opaque framebuffers need to know the session is “outside of a requestAnimationFrame” https://immersive-web.github.io/webxr/#opaque-framebuffer
Implementations§
source§impl XRSession
impl XRSession
fn __assert_parent_type(&self)
source§impl XRSession
impl XRSession
fn new_inherited( session: Session, render_state: &XRRenderState, input_sources: &XRInputSourceArray, mode: XRSessionMode ) -> XRSession
pub fn new( global: &GlobalScope, session: Session, mode: XRSessionMode, frame_receiver: IpcReceiver<Frame> ) -> Root<Dom<XRSession>>
pub fn with_session<R, F: FnOnce(&Session) -> R>(&self, with: F) -> R
pub fn is_ended(&self) -> bool
pub fn is_immersive(&self) -> bool
pub fn has_layers_feature(&self) -> bool
fn setup_raf_loop(&self, frame_receiver: IpcReceiver<Frame>)
pub fn is_outside_raf(&self) -> bool
fn attach_event_handler(&self)
pub fn setup_initial_inputs(&self)
fn event_callback(&self, event: XREvent)
fn update_inline_projection_matrix(&self)
sourcepub fn inline_view(&self) -> View<Viewer>
pub fn inline_view(&self) -> View<Viewer>
Constructs a View suitable for inline sessions using the inlineVerticalFieldOfView and canvas size
pub fn session_id(&self) -> SessionId
pub fn dirty_layers(&self)
fn layers_begin_frame(&self, frame: &XRFrame)
fn layers_end_frame(&self, frame: &XRFrame)
sourcefn apply_frame_updates(&self, _frame: &XRFrame)
fn apply_frame_updates(&self, _frame: &XRFrame)
fn handle_frame_event(&self, event: FrameUpdateEvent)
Trait Implementations§
source§impl Castable for XRSession
impl Castable for XRSession
source§impl DomObjectWrap for XRSession
impl DomObjectWrap for XRSession
source§const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::XRSessionBinding::XRSession_Binding::Wrap as for<'a, 'b> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::xrsession::XRSession>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::xrsession::XRSession>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::XRSessionBinding::XRSession_Binding::Wrap as for<'a, 'b> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::xrsession::XRSession>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::xrsession::XRSession>>}
Function pointer to the general wrap function type
source§impl HasParent for XRSession
impl HasParent for XRSession
source§fn as_parent(&self) -> &EventTarget
fn as_parent(&self) -> &EventTarget
This is used in a type assertion to ensure that the source and webidls agree as to what the parent type is
type Parent = EventTarget
source§impl IDLInterface for XRSession
impl IDLInterface for XRSession
source§impl MallocSizeOf for XRSession
impl MallocSizeOf for XRSession
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
source§impl MutDomObject for XRSession
impl MutDomObject for XRSession
source§unsafe fn init_reflector(&self, obj: *mut JSObject)
unsafe fn init_reflector(&self, obj: *mut JSObject)
Initializes the Reflector
source§impl PartialEq<XRSession> for XRSession
impl PartialEq<XRSession> for XRSession
source§impl ToJSValConvertible for XRSession
impl ToJSValConvertible for XRSession
source§impl XRSessionMethods for XRSession
impl XRSessionMethods for XRSession
source§fn UpdateRenderState(
&self,
init: &XRRenderStateInit,
_: InRealm<'_>
) -> Result<(), Error>
fn UpdateRenderState( &self, init: &XRRenderStateInit, _: InRealm<'_> ) -> Result<(), Error>
source§fn RequestAnimationFrame(&self, callback: Rc<XRFrameRequestCallback>) -> i32
fn RequestAnimationFrame(&self, callback: Rc<XRFrameRequestCallback>) -> i32
source§fn CancelAnimationFrame(&self, frame: i32)
fn CancelAnimationFrame(&self, frame: i32)
source§fn EnvironmentBlendMode(&self) -> XREnvironmentBlendMode
fn EnvironmentBlendMode(&self) -> XREnvironmentBlendMode
source§fn VisibilityState(&self) -> XRVisibilityState
fn VisibilityState(&self) -> XRVisibilityState
source§fn RequestReferenceSpace(
&self,
ty: XRReferenceSpaceType,
comp: InRealm<'_>
) -> Rc<Promise>
fn RequestReferenceSpace( &self, ty: XRReferenceSpaceType, comp: InRealm<'_> ) -> Rc<Promise>
source§fn InputSources(&self) -> Root<Dom<XRInputSourceArray>>
fn InputSources(&self) -> Root<Dom<XRInputSourceArray>>
fn GetOnend(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnend(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnselect(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnselect(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnselectstart(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnselectstart(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnselectend(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnselectend(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnsqueeze(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnsqueeze(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnsqueezestart(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnsqueezestart(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnsqueezeend(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnsqueezeend(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnvisibilitychange(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnvisibilitychange(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOninputsourceschange(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOninputsourceschange(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn RenderState(&self) -> Root<Dom<XRRenderState>>
fn RequestHitTestSource(&self, options: &XRHitTestOptionsInit) -> Rc<Promise>
impl DerivedFrom<EventTarget> for XRSession
Auto Trait Implementations§
impl !RefUnwindSafe for XRSession
impl !Send for XRSession
impl !Sync for XRSession
impl Unpin for XRSession
impl !UnwindSafe for XRSession
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>where
F: FnOnce(&Self) -> bool,
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where F: FnOnce(&Self) -> bool,
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, Global>> for T
impl<T> MaybeBoxed<Box<T, Global>> for T
source§fn maybe_boxed(self) -> Box<T, Global>
fn maybe_boxed(self) -> Box<T, Global>
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