pub struct SyncbackSnapshot<'sync> {
pub data: SyncbackData<'sync>,
pub old: Option<Ref>,
pub new: Ref,
pub path: PathBuf,
pub middleware: Option<Middleware>,
}Fields§
§data: SyncbackData<'sync>§old: Option<Ref>§new: Ref§path: PathBuf§middleware: Option<Middleware>Implementations§
Source§impl<'sync> SyncbackSnapshot<'sync>
impl<'sync> SyncbackSnapshot<'sync>
Sourcepub fn with_joined_path(
&self,
new_ref: Ref,
old_ref: Option<Ref>,
) -> Result<Self>
pub fn with_joined_path( &self, new_ref: Ref, old_ref: Option<Ref>, ) -> Result<Self>
Constructs a SyncbackSnapshot from the provided refs while inheriting this snapshot’s path and data. This should be used for directories.
Sourcepub fn with_base_path(
&self,
base_path: &Path,
new_ref: Ref,
old_ref: Option<Ref>,
) -> Result<Self>
pub fn with_base_path( &self, base_path: &Path, new_ref: Ref, old_ref: Option<Ref>, ) -> Result<Self>
Constructs a SyncbackSnapshot from the provided refs and a base path, while inheriting this snapshot’s data.
The actual path of the snapshot is made by getting a file name for the snapshot and then appending it to the provided base path.
Sourcepub fn with_new_path(
&self,
path: PathBuf,
new_ref: Ref,
old_ref: Option<Ref>,
) -> Self
pub fn with_new_path( &self, path: PathBuf, new_ref: Ref, old_ref: Option<Ref>, ) -> Self
Constructs a SyncbackSnapshot with the provided path and refs while inheriting the data of the this snapshot.
Sourcepub fn middleware(self, middleware: Middleware) -> Self
pub fn middleware(self, middleware: Middleware) -> Self
Allows a middleware to be ‘forced’ onto a SyncbackSnapshot to override the attempts to derive it.
Sourcepub fn get_path_filtered_properties(
&self,
new_ref: Ref,
) -> Option<UstrMap<&'sync Variant>>
pub fn get_path_filtered_properties( &self, new_ref: Ref, ) -> Option<UstrMap<&'sync Variant>>
Returns a map of properties for an Instance from the ‘new’ tree
with filtering done to avoid noise. This method filters out properties
that are not meant to be present in Instances that are represented
specially by a path, like LocalScript.Source and StringValue.Value.
This method is not necessary or desired for blobs like Rbxm or non-path middlewares like JsonModel.
Sourcepub fn get_new_inst_path(&self, referent: Ref) -> String
pub fn get_new_inst_path(&self, referent: Ref) -> String
Returns a path to the provided Instance in the new DOM. This path is where you would look for the object in Roblox Studio.
Sourcepub fn get_old_inst_path(&self, referent: Ref) -> String
pub fn get_old_inst_path(&self, referent: Ref) -> String
Returns a path to the provided Instance in the old DOM. This path is where you would look for the object in Roblox Studio.
Sourcepub fn get_old_instance(&self, referent: Ref) -> Option<InstanceWithMeta<'sync>>
pub fn get_old_instance(&self, referent: Ref) -> Option<InstanceWithMeta<'sync>>
Returns an Instance from the old tree with the provided referent, if it exists.
Sourcepub fn get_new_instance(&self, referent: Ref) -> Option<&'sync Instance>
pub fn get_new_instance(&self, referent: Ref) -> Option<&'sync Instance>
Returns an Instance from the new tree with the provided referent, if it exists.
Sourcepub fn old_inst(&self) -> Option<InstanceWithMeta<'sync>>
pub fn old_inst(&self) -> Option<InstanceWithMeta<'sync>>
The ‘old’ Instance this snapshot is for, if it exists.
Sourcepub fn project(&self) -> &'sync Project
pub fn project(&self) -> &'sync Project
Returns the root Project that was used to make this snapshot.
Sourcepub fn ignore_props(&self) -> Option<&IndexMap<Ustr, Vec<Ustr>>>
pub fn ignore_props(&self) -> Option<&IndexMap<Ustr, Vec<Ustr>>>
Returns user-specified property ignore rules.
Sourcepub fn ignore_tree(&self) -> Option<&[String]>
pub fn ignore_tree(&self) -> Option<&[String]>
Returns user-specified ignore tree.
Auto Trait Implementations§
impl<'sync> Freeze for SyncbackSnapshot<'sync>
impl<'sync> RefUnwindSafe for SyncbackSnapshot<'sync>
impl<'sync> Send for SyncbackSnapshot<'sync>
impl<'sync> Sync for SyncbackSnapshot<'sync>
impl<'sync> Unpin for SyncbackSnapshot<'sync>
impl<'sync> UnsafeUnpin for SyncbackSnapshot<'sync>
impl<'sync> UnwindSafe for SyncbackSnapshot<'sync>
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
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