pub struct RojoTree { /* private fields */ }Expand description
An expanded variant of rbx_dom_weak’s WeakDom that tracks additional
metadata per instance that’s Rojo-specific.
This tree is also optimized for doing fast incremental updates and patches.
Implementations§
Source§impl RojoTree
impl RojoTree
pub fn new(snapshot: InstanceSnapshot) -> RojoTree
pub fn inner(&self) -> &WeakDom
pub fn get_root_id(&self) -> Ref
Sourcepub fn root(&self) -> InstanceWithMeta<'_>
pub fn root(&self) -> InstanceWithMeta<'_>
Returns the root Instance of this tree.
pub fn get_instance(&self, id: Ref) -> Option<InstanceWithMeta<'_>>
pub fn get_instance_mut(&mut self, id: Ref) -> Option<InstanceWithMetaMut<'_>>
pub fn insert_instance( &mut self, parent_ref: Ref, snapshot: InstanceSnapshot, ) -> Ref
pub fn remove(&mut self, id: Ref)
Sourcepub fn update_metadata(&mut self, id: Ref, metadata: InstanceMetadata)
pub fn update_metadata(&mut self, id: Ref, metadata: InstanceMetadata)
Replaces the metadata associated with the given instance ID.
pub fn descendants(&self, id: Ref) -> RojoDescendants<'_> ⓘ
pub fn get_ids_at_path(&self, path: &Path) -> &[Ref]
pub fn get_metadata(&self, id: Ref) -> Option<&InstanceMetadata>
Sourcepub fn get_specified_id(&self, specified: &RojoRef) -> Option<Ref>
pub fn get_specified_id(&self, specified: &RojoRef) -> Option<Ref>
Get the backing Ref of the given RojoRef. If the RojoRef maps to exactly one Ref, this method returns Some. Otherwise, it returns None.
pub fn set_specified_id(&mut self, id: Ref, specified: RojoRef)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RojoTree
impl RefUnwindSafe for RojoTree
impl Send for RojoTree
impl Sync for RojoTree
impl Unpin for RojoTree
impl UnsafeUnpin for RojoTree
impl UnwindSafe for RojoTree
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> 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