pub struct InstanceSnapshot {
pub snapshot_id: Ref,
pub metadata: InstanceMetadata,
pub name: Cow<'static, str>,
pub class_name: Ustr,
pub properties: UstrMap<Variant>,
pub children: Vec<InstanceSnapshot>,
}Expand description
A lightweight description of what an instance should look like.
Fields§
§snapshot_id: RefA temporary ID applied to the snapshot that’s used for Ref properties.
metadata: InstanceMetadataRojo-specific metadata associated with the instance.
name: Cow<'static, str>Correpsonds to the Name property of the instance.
class_name: UstrCorresponds to the ClassName property of the instance.
properties: UstrMap<Variant>All other properties of the instance, weakly-typed.
children: Vec<InstanceSnapshot>The children of the instance represented as more snapshots.
Order is relevant for Roblox instances!
Implementations§
Source§impl InstanceSnapshot
impl InstanceSnapshot
pub fn new() -> Self
pub fn name(self, name: impl Into<String>) -> Self
pub fn class_name<S: Into<Ustr>>(self, class_name: S) -> Self
pub fn property<K, V>(self, key: K, value: V) -> Self
pub fn properties(self, properties: impl Into<UstrMap<Variant>>) -> Self
pub fn children(self, children: impl Into<Vec<Self>>) -> Self
pub fn snapshot_id(self, snapshot_id: Ref) -> Self
pub fn metadata(self, metadata: impl Into<InstanceMetadata>) -> Self
pub fn from_tree(tree: WeakDom, id: Ref) -> Self
Trait Implementations§
Source§impl Clone for InstanceSnapshot
impl Clone for InstanceSnapshot
Source§fn clone(&self) -> InstanceSnapshot
fn clone(&self) -> InstanceSnapshot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InstanceSnapshot
impl Debug for InstanceSnapshot
Source§impl Default for InstanceSnapshot
impl Default for InstanceSnapshot
Source§impl<'de> Deserialize<'de> for InstanceSnapshot
impl<'de> Deserialize<'de> for InstanceSnapshot
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for InstanceSnapshot
impl PartialEq for InstanceSnapshot
Source§fn eq(&self, other: &InstanceSnapshot) -> bool
fn eq(&self, other: &InstanceSnapshot) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for InstanceSnapshot
impl Serialize for InstanceSnapshot
impl StructuralPartialEq for InstanceSnapshot
Auto Trait Implementations§
impl Freeze for InstanceSnapshot
impl RefUnwindSafe for InstanceSnapshot
impl Send for InstanceSnapshot
impl Sync for InstanceSnapshot
impl Unpin for InstanceSnapshot
impl UnsafeUnpin for InstanceSnapshot
impl UnwindSafe for InstanceSnapshot
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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 more