mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-21 03:36:06 +00:00
Expose instance ID and parent ID in web API
This commit is contained in:
parent
f0eb955628
commit
995685adfe
2 changed files with 6 additions and 0 deletions
|
|
@ -57,6 +57,8 @@ impl InstanceMetadata {
|
|||
#[derive(Debug, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct Instance<'a> {
|
||||
pub id: RbxId,
|
||||
pub parent: Option<RbxId>,
|
||||
pub name: Cow<'a, str>,
|
||||
pub class_name: Cow<'a, str>,
|
||||
pub properties: Cow<'a, HashMap<String, RbxValue>>,
|
||||
|
|
@ -67,6 +69,8 @@ pub struct Instance<'a> {
|
|||
impl<'a> Instance<'a> {
|
||||
pub(crate) fn from_rojo_instance<'b>(source: InstanceWithMeta<'b>) -> Instance<'b> {
|
||||
Instance {
|
||||
id: source.id(),
|
||||
parent: source.parent(),
|
||||
name: Cow::Borrowed(source.name()),
|
||||
class_name: Cow::Borrowed(source.class_name()),
|
||||
properties: Cow::Borrowed(source.properties()),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue