pub struct DrawnScene {Show 13 fields
pub kind: SceneKind,
pub objects: Vec<SceneObject>,
pub camera: SceneCamera,
pub lighting: SceneLighting,
pub lights: Vec<SceneLight>,
pub axes: Option<SceneAxes>,
pub motion: Vec<SceneMotion>,
pub select: Option<SceneSelect>,
pub height: Option<u16>,
pub values: Option<SceneValues>,
pub summary: String,
pub panels: Vec<ScenePanel>,
pub text_view: Option<String>,
}Expand description
A 3D scene a home view draws, as HomeNode::Scene.
§Example
use adk_surface::genui::{DrawnScene, SceneKind, SceneObject, SceneShape};
let scene = DrawnScene {
objects: vec![SceneObject::new(
"dock-3",
SceneShape::Box { size: [2.into(), 1.into(), 4.into()] },
)
.labelled("Dock 3")],
..DrawnScene::new(SceneKind::Space)
};
let wire = serde_json::to_value(&scene).unwrap();
assert_eq!(wire["objects"][0]["shape"]["type"], "box");
assert_eq!(wire["camera"]["preset"], "fit");Fields§
§kind: SceneKindWhat the scene is, for its summary and default camera.
objects: Vec<SceneObject>Its objects, parents before children.
camera: SceneCameraWhere it is seen from.
lighting: SceneLightingHow it is lit: a preset whose soft light always stays, so nothing goes dark.
lights: Vec<SceneLight>Up to three more lights.
axes: Option<SceneAxes>Named axes, ticks and a floor grid.
motion: Vec<SceneMotion>Objects that move.
select: Option<SceneSelect>Picking an object fills this field.
height: Option<u16>Its height in CSS pixels, 200 to 960; the home picks one when it is not given.
values: Option<SceneValues>What bar and grid heights stand for in the data’s own numbers, for the summary and the home’s readouts; heights are the data’s numbers when not given.
summary: StringOne sentence that says what the scene shows, for screen readers and the terminal, written by the server: “3D bar chart of Revenue, 24 bars, from 3 to 98”.
panels: Vec<ScenePanel>The held components shown beside objects: written by the server, each the key of one of the node’s children.
text_view: Option<String>The key of the node’s child that says in words what the scene shows, written by the server: shown by “Show as text”, where WebGL is missing, and in the terminal.
Implementations§
Trait Implementations§
Source§impl Clone for DrawnScene
impl Clone for DrawnScene
Source§impl Debug for DrawnScene
impl Debug for DrawnScene
Source§impl<'de> Deserialize<'de> for DrawnScene
impl<'de> Deserialize<'de> for DrawnScene
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for DrawnScene
Source§impl JsonSchema for DrawnScene
impl JsonSchema for DrawnScene
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for DrawnScene
impl PartialEq for DrawnScene
Source§impl Serialize for DrawnScene
impl Serialize for DrawnScene
impl StructuralPartialEq for DrawnScene
Auto Trait Implementations§
impl Forget for DrawnScene
impl Freeze for DrawnScenewhere
*const u8 is !null: Freeze,
PhantomData<SceneObject>: Freeze,
PhantomData<SceneLight>: Freeze,
PhantomData<u8>: Freeze,
PhantomData<SceneTick>: Freeze,
PhantomData<SceneMotion>: Freeze,
PhantomData<ScenePanel>: Freeze,
impl Move for DrawnScene
impl RefUnwindSafe for DrawnScene
impl Send for DrawnScenewhere
RawVecInner: Send,
impl Sync for DrawnScenewhere
RawVecInner: Sync,
impl Unpin for DrawnScene
impl UnsafeUnpin for DrawnScenewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<SceneObject>: UnsafeUnpin,
PhantomData<SceneLight>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<SceneTick>: UnsafeUnpin,
PhantomData<SceneMotion>: UnsafeUnpin,
PhantomData<ScenePanel>: UnsafeUnpin,
impl UnwindSafe for DrawnScenewhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> ⓘ
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> ⓘ
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 more