#[non_exhaustive]pub struct AvatarRedaction {
pub position: Option<Position>,
pub orientation: Option<Orientation>,
pub world_state_keys: Vec<String>,
pub region_state_keys: Vec<String>,
}Expand description
The properties of one SceneAvatar withheld from a caller
(jmap-chat-spec 93f2258 §Avatar Visibility): “Only position,
orientation, worldState, and regionState can be withheld.”
For position and orientation the deployment supplies the value
returned instead, one “that tells the caller nothing it may not know,
such as the region’s spawnPosition and spawnOrientation, or the
values at the time the avatar was last visible to the caller”. For
worldState and regionState “the server leaves out the withheld
top-level keys”. The default withholds nothing.
use jmap_scene_server::AvatarRedaction;
let mut redaction = AvatarRedaction::default();
redaction.position = Some([0.0, 0.0, 5.0]);
redaction.region_state_keys = vec!["money".to_owned()];
assert_eq!(redaction.withheld(), ["position", "regionState"]);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.position: Option<Position>The position returned instead of the stored one; None to
return the stored one.
orientation: Option<Orientation>The orientation returned instead of the stored one; None to
return the stored one.
world_state_keys: Vec<String>The top-level worldState keys left out.
region_state_keys: Vec<String>The top-level regionState keys left out.
Implementations§
Source§impl AvatarRedaction
impl AvatarRedaction
Sourcepub fn apply(&self, avatar: &mut SceneAvatar)
pub fn apply(&self, avatar: &mut SceneAvatar)
Apply this redaction to avatar: replace position and
orientation where set, and remove the listed worldState and
regionState keys. A null or absent state object is left as it
is.