script/dom/webxr/
xrsubimage.rs

1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
5use dom_struct::dom_struct;
6
7use crate::dom::bindings::codegen::Bindings::XRSubImageBinding::XRSubImage_Binding::XRSubImageMethods;
8use crate::dom::bindings::reflector::Reflector;
9use crate::dom::bindings::root::{Dom, DomRoot};
10use crate::dom::xrviewport::XRViewport;
11
12#[dom_struct]
13pub(crate) struct XRSubImage {
14    reflector: Reflector,
15    viewport: Dom<XRViewport>,
16}
17
18impl XRSubImageMethods<crate::DomTypeHolder> for XRSubImage {
19    /// <https://immersive-web.github.io/layers/#dom-xrsubimage-viewport>
20    fn Viewport(&self) -> DomRoot<XRViewport> {
21        DomRoot::from_ref(&self.viewport)
22    }
23}