#[repr(C)]pub struct XRSession {Show 23 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>,
input_frames: DomRefCell<HashMap<InputId, InputFrame>>,
framerate: Cell<f32>,
update_framerate_promise: DomRefCell<Option<Rc<Promise>>>,
reference_spaces: DomRefCell<Vec<Dom<XRReferenceSpace>>>,
}
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
input_frames: DomRefCell<HashMap<InputId, InputFrame>>
§framerate: Cell<f32>
§update_framerate_promise: DomRefCell<Option<Rc<Promise>>>
§reference_spaces: DomRefCell<Vec<Dom<XRReferenceSpace>>>
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, can_gc: CanGc)
sourcefn raf_callback(&self, frame: Frame, time: CrossProcessInstant)
fn raf_callback(&self, frame: Frame, time: CrossProcessInstant)
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)
sourcefn apply_nominal_framerate(&self, rate: f32, can_gc: CanGc)
fn apply_nominal_framerate(&self, rate: f32, can_gc: CanGc)
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>, _: CanGc) -> 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::webxr::xrsession::XRSession>, script_runtime::CanGc) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::webxr::xrsession::XRSession>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>, _: CanGc) -> 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::webxr::xrsession::XRSession>, script_runtime::CanGc) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::webxr::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§impl ToJSValConvertible for XRSession
impl ToJSValConvertible for XRSession
source§impl XRSessionMethods<DomTypeHolder> for XRSession
impl XRSessionMethods<DomTypeHolder> 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<'_>,
can_gc: CanGc,
) -> Rc<Promise>
fn RequestReferenceSpace( &self, ty: XRReferenceSpaceType, comp: InRealm<'_>, can_gc: CanGc, ) -> Rc<Promise>
source§fn InputSources(&self) -> Root<Dom<XRInputSourceArray>>
fn InputSources(&self) -> Root<Dom<XRInputSourceArray>>
source§fn InteractionMode(&self) -> XRInteractionMode
fn InteractionMode(&self) -> XRInteractionMode
source§fn GetSupportedFrameRates(&self, cx: JSContext) -> Option<Float32Array>
fn GetSupportedFrameRates(&self, cx: JSContext) -> Option<Float32Array>
source§fn EnabledFeatures(&self, cx: JSContext, retval: MutableHandleValue<'_>)
fn EnabledFeatures(&self, cx: JSContext, retval: MutableHandleValue<'_>)
source§fn IsSystemKeyboardSupported(&self) -> bool
fn IsSystemKeyboardSupported(&self) -> bool
source§fn UpdateTargetFrameRate(
&self,
rate: Finite<f32>,
comp: InRealm<'_>,
can_gc: CanGc,
) -> Rc<Promise>
fn UpdateTargetFrameRate( &self, rate: Finite<f32>, comp: InRealm<'_>, can_gc: CanGc, ) -> Rc<Promise>
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 GetOnframeratechange(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnframeratechange(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn RenderState(&self) -> Root<Dom<XRRenderState>>
fn RequestHitTestSource( &self, options: &XRHitTestOptionsInit, can_gc: CanGc, ) -> Rc<Promise>
impl DerivedFrom<EventTarget> for XRSession
impl Eq for XRSession
Auto Trait Implementations§
impl !Freeze for XRSession
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> Filterable for T
impl<T> Filterable for T
source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
Creates a filterable data provider with the given name for debugging. 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