pub struct InstanceMetadata {
pub ignore_unknown_instances: bool,
pub instigating_source: Option<InstigatingSource>,
pub relevant_paths: Vec<PathBuf>,
pub context: InstanceContext,
pub specified_id: Option<RojoRef>,
pub middleware: Option<Middleware>,
pub schema: Option<String>,
}Expand description
Rojo-specific metadata that can be associated with an instance or a snapshot of an instance.
Fields§
§ignore_unknown_instances: boolWhether instances not present in the source should be ignored when live-syncing. This is useful when there are instances that Rojo does not manage.
instigating_source: Option<InstigatingSource>If a change occurs to this instance, the instigating source is what should be run through the snapshot functions to regenerate it.
relevant_paths: Vec<PathBuf>The paths that, when changed, could cause the function that generated this snapshot to generate a different snapshot. Paths should be included even if they don’t exist, since the presence of a file can change the outcome of a snapshot function.
For example, a file named foo.lua might have these relevant paths:
- foo.lua
- foo.meta.json (even if this file doesn’t exist!)
A directory named bar/ might have these:
- bar/
- bar/init.meta.json
- bar/init.lua
- bar/init.server.lua
- bar/init.client.lua
- bar/default.project.json
This path is used to make sure that file changes update all instances that may need updates.
context: InstanceContextContains information about this instance that should persist between snapshot invocations and is generally inherited.
If an instance has a piece of context attached to it, then the next time that instance’s instigating source is snapshotted directly, the same context will be passed into it.
specified_id: Option<RojoRef>Indicates the ID used for Ref properties pointing to this Instance.
middleware: Option<Middleware>The Middleware that was used to create this Instance. Should generally
not be None except if the snapshotting process is not completed.
schema: Option<String>A schema provided via a JSON file, if one exists. Will be None for
all non-JSON middleware.
Implementations§
Source§impl InstanceMetadata
impl InstanceMetadata
pub fn new() -> Self
pub fn ignore_unknown_instances(self, ignore_unknown_instances: bool) -> Self
pub fn instigating_source( self, instigating_source: impl Into<InstigatingSource>, ) -> Self
pub fn relevant_paths(self, relevant_paths: Vec<PathBuf>) -> Self
pub fn context(self, context: &InstanceContext) -> Self
pub fn specified_id(self, id: Option<RojoRef>) -> Self
pub fn middleware(self, middleware: Middleware) -> Self
pub fn schema(self, schema: Option<String>) -> Self
Trait Implementations§
Source§impl Clone for InstanceMetadata
impl Clone for InstanceMetadata
Source§fn clone(&self) -> InstanceMetadata
fn clone(&self) -> InstanceMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InstanceMetadata
impl Debug for InstanceMetadata
Source§impl Default for InstanceMetadata
impl Default for InstanceMetadata
Source§impl<'de> Deserialize<'de> for InstanceMetadata
impl<'de> Deserialize<'de> for InstanceMetadata
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>,
Source§impl PartialEq for InstanceMetadata
impl PartialEq for InstanceMetadata
Source§fn eq(&self, other: &InstanceMetadata) -> bool
fn eq(&self, other: &InstanceMetadata) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for InstanceMetadata
impl Serialize for InstanceMetadata
impl StructuralPartialEq for InstanceMetadata
Auto Trait Implementations§
impl Freeze for InstanceMetadata
impl RefUnwindSafe for InstanceMetadata
impl Send for InstanceMetadata
impl Sync for InstanceMetadata
impl Unpin for InstanceMetadata
impl UnsafeUnpin for InstanceMetadata
impl UnwindSafe for InstanceMetadata
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> 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>
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